ci(publish): attempt every package and report all publish failures#320
Merged
Conversation
The rc.3 publish aborted on the first package (@stitchapi/angular, ENEEDAUTH from a missing/mismatched npm Trusted Publisher) because the loop ran under errexit. That masked the state of all 29 packages after it, turning the release into a blind one-failure-per-run grind. Make the loop attempt every publishable package, record pack/publish failures instead of aborting (each npm publish runs under an `if`, which errexit exempts), and exit non-zero at the end with a summary that names every package that failed plus the likely Trusted-Publisher fix. Successful publishes still land; the re-run skips them, so it only retries failures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The rc.3 publish keeps dying on the first package —
@stitchapi/angular→ENEEDAUTH(a missing/mismatched npm Trusted Publisher). The loop runs underset -euo pipefail, so that first failure aborts everything, hiding whether the other 20 new packages are also broken. Diagnosing this one re-run at a time (each ~5 min) is painful and slow.What
The publish loop now attempts every package and collects failures instead of aborting:
npm publish(andpnpm pack) runs under anif— errexit is exempt inside anifcondition, so a failure is recorded, not fatal.published / skipped / failedsummary and, if anything failed, exits 1 with a::error::naming every failed package and the likely Trusted-Publisher fix.Net effect: one run gives the complete list of packages whose Trusted Publisher still needs fixing, instead of revealing them one corpse at a time.
Verification
prettier --check✓bash -e/set -euo pipefail: a mid-loop failure does not stop later packages, the summary is correct, exit code is 1 when any package fails and 0 when none do, and empty-array access is safe underset -u.🤖 Generated with Claude Code