fix(ci): use boolean workflow_call inputs for run_build/sonar/deploy
Gitea/Act can mis-coerce string-typed inputs when callers pass YAML booleans, which skipped Sonar and Deploy while Build ran. Use type boolean and simplify job if conditions. Document caller pitfalls in readme. Made-with: Cursor
This commit is contained in:
@@ -3,14 +3,17 @@ 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.
|
||||
run_build:
|
||||
type: string
|
||||
type: boolean
|
||||
required: true
|
||||
run_sonar:
|
||||
type: string
|
||||
type: boolean
|
||||
required: true
|
||||
run_deploy:
|
||||
type: string
|
||||
type: boolean
|
||||
required: true
|
||||
wait_for_quality_gate:
|
||||
type: string
|
||||
@@ -88,7 +91,7 @@ jobs:
|
||||
|
||||
# 🔨 BUILD
|
||||
build:
|
||||
if: ${{ inputs.run_build == true || inputs.run_build == 'true' }}
|
||||
if: ${{ inputs.run_build }}
|
||||
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main
|
||||
with:
|
||||
tech_stack: ${{ inputs.tech_stack }}
|
||||
@@ -96,7 +99,7 @@ jobs:
|
||||
|
||||
# 🔍 SONAR
|
||||
sonar:
|
||||
if: ${{ inputs.run_sonar == true || inputs.run_sonar == 'true' }}
|
||||
if: ${{ inputs.run_sonar }}
|
||||
needs: build
|
||||
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@main
|
||||
with:
|
||||
@@ -108,7 +111,7 @@ jobs:
|
||||
|
||||
# 🚀 DEPLOY (runs after build; sonar may be skipped)
|
||||
deploy:
|
||||
if: ${{ always() && (inputs.run_deploy == true || inputs.run_deploy == 'true') && needs.build.result == 'success' && (needs.sonar.result == 'success' || needs.sonar.result == 'skipped') }}
|
||||
if: ${{ always() && inputs.run_deploy && 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:
|
||||
|
||||
@@ -30,7 +30,9 @@ jobs:
|
||||
with:
|
||||
tech_stack: node
|
||||
|
||||
# run_* flags: use YAML `true`/`false` or "true"/"false" — central workflow treats both.
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user