From 323dd0f09e3dd382a646dbccd66359cca732320e Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Wed, 11 Nov 2026 15:32:31 +0100 Subject: [PATCH] CI: config-job leest Gitea-variabelen op stap-niveau en faalt bij lege test-variabelen (leeg deploy-pad op pc-runner) Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/continuous_integration.yaml | 28 +++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/continuous_integration.yaml b/.gitea/workflows/continuous_integration.yaml index 8909d57..471d424 100644 --- a/.gitea/workflows/continuous_integration.yaml +++ b/.gitea/workflows/continuous_integration.yaml @@ -73,18 +73,34 @@ jobs: run: | echo "Deploy to Test: ${{ github.event.inputs.deploy_test }}" echo "Deploy to Production: ${{ github.event.inputs.deploy_production }}" + # The Gitea variables are read at STEP level (like config-asf), not through the workflow-level env block: on the PC + # runner the workflow-level `${{ vars.* }}` values came through empty (deploy path "" -> mkdir /releases), while + # step-level env works on both runners. The test trio must be set, otherwise fail here instead of in the deploy. - id: set + env: + DEPLOY_PATH_TEST: ${{ vars.DEPLOY_PATH_TEST }} + DEPLOY_PATH_PRODUCTION: ${{ vars.DEPLOY_PATH_PRODUCTION }} + SERVICE_NAME_TEST: ${{ vars.SERVICE_NAME_TEST }} + SERVICE_NAME_PRODUCTION: ${{ vars.SERVICE_NAME_PRODUCTION }} + HEALTH_CHECK_URL_TEST: ${{ vars.HEALTH_CHECK_URL_TEST }} + HEALTH_CHECK_URL_PRODUCTION: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }} run: | + for v in DEPLOY_PATH_TEST SERVICE_NAME_TEST HEALTH_CHECK_URL_TEST; do + if [ -z "${!v}" ]; then + echo "The Gitea variable $v is empty or not set on this runner; the deploy would use an empty path." + exit 1 + fi + done echo "artifact_name_test=${{ env.ARTIFACT_NAME_TEST }}" >> "$GITHUB_OUTPUT" echo "artifact_name_production=${{ env.ARTIFACT_NAME_PRODUCTION }}" >> "$GITHUB_OUTPUT" echo "deploy_environment_test=${{ env.DEPLOY_ENVIRONMENT_TEST }}" >> "$GITHUB_OUTPUT" echo "deploy_environment_production=${{ env.DEPLOY_ENVIRONMENT_PRODUCTION }}" >> "$GITHUB_OUTPUT" - echo "deploy_path_test=${{ env.DEPLOY_PATH_TEST }}" >> "$GITHUB_OUTPUT" - echo "deploy_path_production=${{ env.DEPLOY_PATH_PRODUCTION }}" >> "$GITHUB_OUTPUT" - echo "service_name_test=${{ env.SERVICE_NAME_TEST }}" >> "$GITHUB_OUTPUT" - echo "service_name_production=${{ env.SERVICE_NAME_PRODUCTION }}" >> "$GITHUB_OUTPUT" - echo "health_check_url_test=${{ env.HEALTH_CHECK_URL_TEST }}" >> "$GITHUB_OUTPUT" - echo "health_check_url_production=${{ env.HEALTH_CHECK_URL_PRODUCTION }}" >> "$GITHUB_OUTPUT" + echo "deploy_path_test=$DEPLOY_PATH_TEST" >> "$GITHUB_OUTPUT" + echo "deploy_path_production=$DEPLOY_PATH_PRODUCTION" >> "$GITHUB_OUTPUT" + echo "service_name_test=$SERVICE_NAME_TEST" >> "$GITHUB_OUTPUT" + echo "service_name_production=$SERVICE_NAME_PRODUCTION" >> "$GITHUB_OUTPUT" + echo "health_check_url_test=$HEALTH_CHECK_URL_TEST" >> "$GITHUB_OUTPUT" + echo "health_check_url_production=$HEALTH_CHECK_URL_PRODUCTION" >> "$GITHUB_OUTPUT" # Path-based skip: keeps the pipeline short when a change only touches one side of the repo. # fetch-depth: 0 gives paths-filter full local git history to diff against, rather than relying