Skip to content

Commit c080619

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Fix skipped post-publish jobs in release mode (#57479)
Summary: During the 0.87.0-rc.0 release, the npm packages published successfully (`publish_react_native` ✓) but every release-only downstream job was **skipped**: `post_publish`, `generate_changelog`, `bump_podfile_lock`, and `create_draft_release`. As a result the community template was not published, rn-diff-purge was not triggered, npm/Maven verification did not run, the changelog was not generated, `Podfile.lock` was not bumped, and no draft GitHub release was created. ### Root cause These four jobs gate on a bare condition: ```yaml if: needs.determine_mode.outputs.mode == 'release' ``` Because that expression contains no status-check function, GitHub Actions implicitly ANDs a `success()` gate. `success()` evaluates to false when there is a **skipped job in the dependency graph**. In release mode, `build_android` (a dependency of `publish_react_native`) is always skipped, which poisons the implicit `success()` for these downstream jobs — so they skip even after a fully successful publish. `publish_react_native` already works around exactly this with `always()` + explicit `.result == 'success'` checks (see its existing `if:` and comment). This PR applies the same, proven pattern to the four downstream jobs. ### Fix Replace each bare `if:` with `always()` plus explicit result checks so the jobs run whenever the release publish actually succeeds, and only in release mode: ```yaml if: | always() && needs.determine_mode.result == 'success' && needs.publish_react_native.result == 'success' && needs.determine_mode.outputs.mode == 'release' ``` (`create_draft_release` checks `generate_changelog` and `set_hermes_version` instead, matching its `needs`.) ## Changelog: [Internal] - ### Notes - This bug is structural — it affects **every** release, not just rc.0, since `build_android` is always skipped in release mode. - A companion PR backports this fix to `0.87-stable`. Pull Request resolved: #57479 Test Plan: - `if` expressions unchanged in intent: run only for a successful release publish, skip for nightly/bumped-packages. - YAML validated locally. - Verify on the next release that `post_publish`, `generate_changelog`, `bump_podfile_lock`, and `create_draft_release` all run after `publish_react_native` succeeds. Reviewed By: cortinico Differential Revision: D111035339 Pulled By: cipolleschi fbshipit-source-id: ce26ef974909af85087dcba263430e5e3ec7b990
1 parent ba71ce8 commit c080619

1 file changed

Lines changed: 31 additions & 4 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,15 @@ jobs:
201201
post_publish:
202202
runs-on: ubuntu-latest
203203
needs: [determine_mode, publish_react_native]
204-
if: needs.determine_mode.outputs.mode == 'release'
204+
# Use always() so this job still runs in release mode even though some
205+
# upstream jobs (e.g. build_android) are skipped and would otherwise
206+
# poison the implicit success() gate. The explicit result checks below
207+
# handle the real gating: only run for a successful release publish.
208+
if: |
209+
always() &&
210+
needs.determine_mode.result == 'success' &&
211+
needs.publish_react_native.result == 'success' &&
212+
needs.determine_mode.outputs.mode == 'release'
205213
env:
206214
REACT_NATIVE_BOT_GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
207215
steps:
@@ -256,19 +264,38 @@ jobs:
256264
# ─── Release-only: changelog, podfile bump, draft release ────────
257265
generate_changelog:
258266
needs: [determine_mode, publish_react_native]
259-
if: needs.determine_mode.outputs.mode == 'release'
267+
# always() + explicit result checks: run for a successful release publish
268+
# even when skipped upstream jobs would trip the implicit success() gate.
269+
if: |
270+
always() &&
271+
needs.determine_mode.result == 'success' &&
272+
needs.publish_react_native.result == 'success' &&
273+
needs.determine_mode.outputs.mode == 'release'
260274
uses: ./.github/workflows/generate-changelog.yml
261275
secrets: inherit
262276

263277
bump_podfile_lock:
264278
needs: [determine_mode, publish_react_native]
265-
if: needs.determine_mode.outputs.mode == 'release'
279+
# always() + explicit result checks: run for a successful release publish
280+
# even when skipped upstream jobs would trip the implicit success() gate.
281+
if: |
282+
always() &&
283+
needs.determine_mode.result == 'success' &&
284+
needs.publish_react_native.result == 'success' &&
285+
needs.determine_mode.outputs.mode == 'release'
266286
uses: ./.github/workflows/bump-podfile-lock.yml
267287
secrets: inherit
268288

269289
create_draft_release:
270290
needs: [determine_mode, generate_changelog, set_hermes_version]
271-
if: needs.determine_mode.outputs.mode == 'release'
291+
# always() + explicit result checks: run for a successful release even when
292+
# skipped upstream jobs would trip the implicit success() gate.
293+
if: |
294+
always() &&
295+
needs.determine_mode.result == 'success' &&
296+
needs.generate_changelog.result == 'success' &&
297+
needs.set_hermes_version.result == 'success' &&
298+
needs.determine_mode.outputs.mode == 'release'
272299
uses: ./.github/workflows/create-draft-release.yml
273300
secrets: inherit
274301
with:

0 commit comments

Comments
 (0)