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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user