From 20190d38822edf5bb4bf69b3621e31c5f8e3cb1d Mon Sep 17 00:00:00 2001 From: Pedro Valerio <124090200+Pedrovaleriolopez@users.noreply.github.com> Date: Sat, 15 Aug 2026 14:39:45 -0300 Subject: [PATCH] fix(ci): add always() to publish_legacy_aiox_core so scoped packages=aiox-core dispatches actually run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug 3 from issue #827: publish_legacy_aiox_core's `if:` explicitly tries to allow `needs.publish.result == 'skipped'` (the expected state when a scoped `packages=aiox-core` dispatch, without `core`, causes `publish`'s own `if:` to evaluate false). But GitHub Actions propagates a skipped `needs` job to dependents by default, REGARDLESS of a custom `if:` expression — the only way to opt out is to start the expression with `always()`. Without it, the "skipped is OK" branch of the condition was dead code: a scoped `packages=aiox-core`-only dispatch could never actually run this job, verified live in runs #31897480528 and #31898069540 (both show `publish_legacy_aiox_core: skipped`). Adding `always()` also removes the *implicit* failure-propagation default for every `needs` entry, not just `publish` — so the explicit `needs.test.result == 'success' && needs.build.result == 'success'` checks are load-bearing here, not decorative. Without them this job would now run even when `test` or `build` failed. No behavior change intended for the `packages=all` / `packages=core` paths already exercised in production (run #31898409032, which correctly ran `publish_legacy_aiox_core` and published `aiox-core` because `publish` itself was NOT skipped there) — this only changes what happens for the previously-dead `packages=aiox-core`-only input. Co-Authored-By: Claude Opus 5 --- .github/workflows/npm-publish.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 4ee97ac44..0c5a69bf3 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -397,8 +397,21 @@ jobs: # in parallel, the legacy smoke test races against npm propagation of the # scoped package and times out — making the workflow appear failed even # though both packages were published successfully. + # + # `needs.publish.result == 'skipped'` is an intentionally allowed case + # (a scoped `packages=aiox-core` dispatch, without `core`, skips `publish` + # by design). GitHub Actions propagates a skipped `needs` job to this job + # by default REGARDLESS of a custom `if:` — the only way to opt out of + # that default propagation is to start the expression with `always()`. + # Without it, this whole condition was dead code: a scoped + # `packages=aiox-core` dispatch could never actually run this job. See + # https://github.com/SynkraAI/aiox-core/issues/827 (Bug 3). + # + # `always()` also bypasses the *failure*-propagation default, so the + # `test`/`build` success checks below are load-bearing, not redundant — + # without them this job would run even when `test` or `build` failed. needs: [test, build, publish] - if: ${{ contains(format(',{0},', needs.build.outputs.packages), ',aiox-core,') && (needs.publish.result == 'success' || needs.publish.result == 'skipped') }} + if: ${{ always() && needs.test.result == 'success' && needs.build.result == 'success' && contains(format(',{0},', needs.build.outputs.packages), ',aiox-core,') && (needs.publish.result == 'success' || needs.publish.result == 'skipped') }} runs-on: ubuntu-latest outputs: published: ${{ steps.should-publish.outputs.should_publish }}