From d5fd823dd9da9bae68ea8f9edce152fe9f085b87 Mon Sep 17 00:00:00 2001 From: WDI-Ideas Date: Tue, 7 Apr 2026 23:47:30 +0530 Subject: [PATCH] fix(ci): Act runner string compare for run_*; use string inputs and quoted flags in docs WDIPL-Runner evaluates workflow_call flags as == 'true'. YAML booleans broke job if conditions. Accept true or 'true' in expressions; document quoted strings. Made-with: Cursor --- .gitea/workflows/ci.yml | 17 ++++++++--------- readme.md | 18 ++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 049e326..769cdd9 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -3,17 +3,16 @@ name: Central CI on: workflow_call: inputs: - # Use boolean (not string). Callers must pass YAML true/false — not "true" in quotes. - # With type: string, Gitea/Act often mis-coerces multiple YAML booleans; build could look - # "true" in logs while run_sonar / run_deploy arrive empty or false. + # Gitea Act may lower if: to inputs.* == 'true'. Use string inputs and quoted 'true' in callers, + # plus if: that accepts both boolean true and string 'true'. run_build: - type: boolean + type: string required: true run_sonar: - type: boolean + type: string required: true run_deploy: - type: boolean + type: string required: true wait_for_quality_gate: type: string @@ -91,7 +90,7 @@ jobs: # 🔨 BUILD build: - if: ${{ inputs.run_build }} + if: ${{ inputs.run_build == true || inputs.run_build == 'true' }} uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main with: tech_stack: ${{ inputs.tech_stack }} @@ -99,7 +98,7 @@ jobs: # 🔍 SONAR sonar: - if: ${{ inputs.run_sonar }} + if: ${{ inputs.run_sonar == true || inputs.run_sonar == 'true' }} needs: build uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@main with: @@ -111,7 +110,7 @@ jobs: # 🚀 DEPLOY (runs after build; sonar may be skipped) deploy: - if: ${{ always() && inputs.run_deploy && needs.build.result == 'success' && (needs.sonar.result == 'success' || needs.sonar.result == 'skipped') }} + if: ${{ always() && (inputs.run_deploy == true || inputs.run_deploy == 'true') && needs.build.result == 'success' && (needs.sonar.result == 'success' || needs.sonar.result == 'skipped') }} needs: [build, sonar] uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/deploy.yml@main with: diff --git a/readme.md b/readme.md index 1452bae..a74a0b0 100644 --- a/readme.md +++ b/readme.md @@ -30,12 +30,10 @@ jobs: with: tech_stack: node - # run_* flags: YAML true/false only (central workflow uses type: boolean). - # If Sonar/Deploy were skipped while Build ran, you likely had type:string + bad coercion; - # ensure these keys sit under `with:` (not `secrets:`) and names are run_sonar / run_deploy. - run_build: true - run_sonar: true - run_deploy: true + # run_* flags: use quoted 'true' / 'false' (Gitea Act evaluates inputs.run_* == 'true'). + run_build: 'true' + run_sonar: 'true' + run_deploy: 'true' wait_for_quality_gate: 'false' app_path_beta: /var/www/app-beta @@ -121,10 +119,10 @@ jobs: | Variable | What to set | | --------------------- | ---------------------- | | tech_stack | node / react / nestjs | -| run_build | true/false | -| run_sonar | true/false | -| run_deploy | true/false | -| wait_for_quality_gate | true/false | +| run_build | `'true'` / `'false'` (quoted) | +| run_sonar | `'true'` / `'false'` (quoted) | +| run_deploy | `'true'` / `'false'` (quoted) | +| wait_for_quality_gate | `'true'` / `'false'` (quoted) | | app_path_beta | path on beta server | | app_path_staging | path on staging server | | app_path_prod | path on prod server |