Files
gitea-ci-library/.gitea/workflows/config-provider.yml
T
moilanik 80f3d4392a
CI / load-config (push) Failing after 0s
CI / main (push) Has been skipped
CI / feature (push) Has been skipped
esitellään env conf tiedosto
2026-06-13 10:37:33 +03:00

32 lines
773 B
YAML

name: Config Provider Library
on:
workflow_call:
inputs:
config_path:
required: true
type: string
outputs:
env_json:
value: ${{ jobs.parse-config.outputs.json_data }}
jobs:
parse-config:
runs-on: ubuntu-latest
outputs:
json_data: ${{ steps.convert.outputs.JSON_OUT }}
steps:
- uses: actions/checkout@v4
- id: convert
run: |
JSON_STRING=$(jq -R -s '
split("\n")
| map(select(length > 0 and (startswith("#") | not)))
| map(split("="))
| map({(.[0]): .[1]})
| add
' "${{ inputs.config_path }}")
CLEAN_JSON=$(echo "$JSON_STRING" | jq -c .)
echo "JSON_OUT=$CLEAN_JSON" >> "$GITHUB_OUTPUT"