Skip to content

ci(publish): attempt every package and report all publish failures#320

Merged
rejifald merged 1 commit into
mainfrom
worktree-harden-publish-loop
Jun 21, 2026
Merged

ci(publish): attempt every package and report all publish failures#320
rejifald merged 1 commit into
mainfrom
worktree-harden-publish-loop

Conversation

@rejifald

Copy link
Copy Markdown
Owner

Why

The rc.3 publish keeps dying on the first package — @stitchapi/angularENEEDAUTH (a missing/mismatched npm Trusted Publisher). The loop runs under set -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:

  • Each npm publish (and pnpm pack) runs under an if — errexit is exempt inside an if condition, so a failure is recorded, not fatal.
  • Successful publishes still land (and the re-run skips already-published versions — unchanged idempotency).
  • At the end it prints a published / skipped / failed summary 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

  • YAML parses; prettier --check
  • Bash logic simulated under 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 under set -u.

🤖 Generated with Claude Code

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>
@rejifald rejifald merged commit 0d69392 into main Jun 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant