Files
gitea-ci-library/.gitea/workflows/config-provider.yml
T
niko bd6ed5c2c2
CI Gitea Reports Main / Config load (push) Successful in 17s
CI Main / Config load (push) Successful in 20s
CI Gitea Reports Main / Latest version (push) Successful in 17s
CI Main / Latest versio (push) Successful in 19s
ci-helm-build-push Helm push 0.2.0
CI Gitea Reports Main / Build & Push Helm chart (push) Successful in 33s
gitops/gitea-ci-library/gitea-reports GitOps: gitea-reports 0.2.0
CI Gitea Reports Main / GitOps (push) Successful in 33s
CI Gitea Reports Main / Report Summary (push) Successful in 3s
CI Main / Bats tests (push) Failing after 1m16s
CI Main / Cucumber tests (push) Failing after 1m22s
CI Main / Build & Push Docker (push) Has been skipped
CI Main / GitOps (push) Has been skipped
CI Main / Move provider version tag (push) Has been skipped
CI Main / Report Summary (push) Successful in 3s
Feature/git pages -> oma nginx perusteinen raporointipalvelu (#48)
Co-authored-by: moilanik <niko.moilanen@tietoevry.com>
Reviewed-on: #48
2026-06-28 09:10:10 +03:00

55 lines
1.4 KiB
YAML

name: Config Provider
on:
workflow_call:
inputs:
config_path:
required: true
type: string
secrets:
GITEA_TOKEN:
required: true
REPORTS_PUBLISH_TOKEN:
required: true
outputs:
env_json:
value: ${{ jobs.parse-config.outputs.json_data }}
config_path:
value: ${{ jobs.parse-config.outputs.config_path }}
env:
CI_CONF_FILE: ${{ inputs.config_path }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
REPORTS_PUBLISH_TOKEN: ${{ secrets.REPORTS_PUBLISH_TOKEN }}
jobs:
parse-config:
runs-on: ubuntu-latest
outputs:
json_data: ${{ steps.convert.outputs.JSON_OUT }}
config_path: ${{ steps.set-path.outputs.CONFIG_PATH }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: niko/gitea-ci-library
path: .ci
- name: Validate CI config
run: bash .ci/scripts/ci-validate.sh
- 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"
- id: set-path
run: echo "CONFIG_PATH=${{ inputs.config_path }}" >> "$GITHUB_OUTPUT"