fix(ci): meta job snapshots ci_steps to outputs (WDIPL clears inputs after build)

Sonar/deploy if used inputs.ci_steps false after build finished; capture once in meta.

Made-with: Cursor
This commit is contained in:
WDI-Ideas
2026-04-08 00:03:26 +05:30
parent 653028c113
commit 08e779fe57
2 changed files with 18 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ on:
# WDIPL-Runner v0.2.12: only the first truthy workflow_call flag reached nested jobs; the rest
# were empty. Use ONE comma-separated input so Act forwards a single string with all steps.
# Tokens: build, sonar, deploy (e.g. build,sonar,deploy). No spaces — WDIPL-Runner has no replace().
# Runner drops inputs.ci_steps after the first reusable child; job `meta` copies it to outputs (needs.meta.outputs.cs).
ci_steps:
type: string
required: true
@@ -83,9 +84,19 @@ on:
jobs:
meta:
runs-on: ubuntu-latest
steps:
- name: Capture ci_steps for later job if
id: snap
run: echo "cs=${{ inputs.ci_steps }}" >> "$GITHUB_OUTPUT"
outputs:
cs: ${{ steps.snap.outputs.cs }}
# 🔨 BUILD
build:
if: ${{ contains(format(',{0},', inputs.ci_steps), ',build,') }}
if: ${{ contains(format(',{0},', needs.meta.outputs.cs), ',build,') }}
needs: [meta]
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}
@@ -93,8 +104,8 @@ jobs:
# 🔍 SONAR
sonar:
if: ${{ contains(format(',{0},', inputs.ci_steps), ',sonar,') }}
needs: build
if: ${{ contains(format(',{0},', needs.meta.outputs.cs), ',sonar,') }}
needs: [meta, build]
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@main
with:
project_key: ${{ github.event.repository.name }}
@@ -105,8 +116,8 @@ jobs:
# 🚀 DEPLOY (runs after build; sonar may be skipped)
deploy:
if: ${{ always() && contains(format(',{0},', inputs.ci_steps), ',deploy,') && needs.build.result == 'success' && (needs.sonar.result == 'success' || needs.sonar.result == 'skipped') }}
needs: [build, sonar]
if: ${{ always() && contains(format(',{0},', needs.meta.outputs.cs), ',deploy,') && needs.build.result == 'success' && (needs.sonar.result == 'success' || needs.sonar.result == 'skipped') }}
needs: [meta, build, sonar]
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/deploy.yml@main
with:
tech_stack: ${{ inputs.tech_stack }}

View File

@@ -158,6 +158,8 @@ pm2 reload <pm2_id>
The runner caches clones under **`/root/.cache/act/`** (e.g. `Rajendra.Reddy-wdipl-actions@main`). After you change **`wdipl-actions`**, consumers may still execute an **old `ci.yml`** (wrong `if:` / missing `ci_steps`).
Central **`ci.yml`** includes a **`meta` job** that writes `ci_steps` to **`$GITHUB_OUTPUT`** so **`needs.meta.outputs.cs`** stays available for Sonar/Deploy: WDIPL-Runner clears **`inputs.ci_steps`** after the Build reusable workflow runs.
**Fix one of:**
1. Pin **`uses:` to a commit SHA** from `wdipl-actions`, e.g.