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
This commit is contained in:
WDI-Ideas
2026-04-07 23:47:30 +05:30
parent 45fa192924
commit d5fd823dd9
2 changed files with 16 additions and 19 deletions

View File

@@ -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:

View File

@@ -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 |