Skip to content

Commit f252325

Browse files
committed
fix(ci): stop skip-cascade from release-please poisoning downstream jobs
GitHub's default if:success() walks the entire transitive needs chain, not just direct needs -- so with release-please skipped (workflow_dispatch), every job downstream of verify_version was silently skipped too, even though verify_version itself succeeded. Confirmed via a live rehearsal run on this branch. Give each job its own always() + explicit direct-need check instead of relying on the implicit default.
1 parent a86c1fa commit f252325

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
# This is release-please-action's own documented pattern for this problem.
2020
#
2121
# `workflow_dispatch` is kept for manual rebuilds (e.g. to regenerate
22-
# artifacts for a backfill) -- on that trigger the release-please job is
23-
# skipped, `verify_version` skips its tag-match check, and
24-
# `upload_pyodide_asset` is skipped entirely (nothing to attach to).
22+
# artifacts) -- on that trigger the release-please job is skipped and
23+
# `verify_version` skips its tag-match check (no fresh tag to check
24+
# against).
2525
#
2626
# Uses OIDC trusted publishing for PyPI -- no stored PyPI token required.
2727
# macOS uses macos-14 (arm64); cibuildwheel cross-compiles x86_64 as well
@@ -85,6 +85,12 @@ jobs:
8585
build_wheels:
8686
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }})
8787
needs: verify_version
88+
# always() + explicit check, not the default if:success() -- success()
89+
# walks the *entire transitive* needs chain, not just direct needs, so
90+
# it would see release-please's skip (verify_version's own ancestor)
91+
# and auto-skip this job too even though verify_version itself
92+
# succeeded. Confirmed empirically via a workflow_dispatch rehearsal.
93+
if: always() && needs.verify_version.result == 'success'
8894
runs-on: ${{ matrix.os }}
8995
strategy:
9096
matrix:
@@ -112,6 +118,9 @@ jobs:
112118
build_pyodide:
113119
name: Build pure-Python wheel (for Pyodide/JupyterLite)
114120
needs: verify_version
121+
# See build_wheels' comment above for why always() + an explicit check
122+
# is needed instead of the default if:success().
123+
if: always() && needs.verify_version.result == 'success'
115124
runs-on: ubuntu-latest
116125
steps:
117126
- uses: actions/checkout@v7
@@ -154,6 +163,9 @@ jobs:
154163
build_sdist:
155164
name: Build source distribution
156165
needs: verify_version
166+
# See build_wheels' comment above for why always() + an explicit check
167+
# is needed instead of the default if:success().
168+
if: always() && needs.verify_version.result == 'success'
157169
runs-on: ubuntu-latest
158170
steps:
159171
- uses: actions/checkout@v7
@@ -169,6 +181,9 @@ jobs:
169181
smoke_test:
170182
name: Smoke-test Linux wheel
171183
needs: build_wheels
184+
# See build_wheels' comment above for why always() + an explicit check
185+
# is needed instead of the default if:success().
186+
if: always() && needs.build_wheels.result == 'success'
172187
runs-on: ubuntu-latest
173188
steps:
174189
- uses: actions/setup-python@v7
@@ -189,6 +204,14 @@ jobs:
189204

190205
upload_pypi:
191206
needs: [build_wheels, build_pyodide, build_sdist, smoke_test]
207+
# See build_wheels' comment above for why always() + an explicit check
208+
# is needed instead of the default if:success().
209+
if: >
210+
always() &&
211+
needs.build_wheels.result == 'success' &&
212+
needs.build_pyodide.result == 'success' &&
213+
needs.build_sdist.result == 'success' &&
214+
needs.smoke_test.result == 'success'
192215
runs-on: ubuntu-latest
193216
environment: pypi
194217
permissions:

0 commit comments

Comments
 (0)