Skip to content

Report staged package ids from the publish output, not npm stage list - #16

Merged
antstanley merged 1 commit into
mainfrom
fix/release-staged-summary
Jul 25, 2026
Merged

Report staged package ids from the publish output, not npm stage list#16
antstanley merged 1 commit into
mainfrom
fix/release-staged-summary

Conversation

@antstanley

Copy link
Copy Markdown
Owner

The v0.3.3 release run reported ✅ success while its final step failed with npm error code E401 — Unable to authenticate and printed nothing. It was wrapped in || true, so it could not fail the job. The one step whose purpose is to tell you which packages to approve was silently dead.

It cannot work as written. actions/setup-node writes .npmrc with _authToken=${NODE_AUTH_TOKEN}, and this workflow ships no npm token by design — so that value is setup-node's placeholder (visible in the log as NODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX). npm stage publish survives because npm swaps the Actions OIDC token for a short-lived credential, but that exchange only covers publish commands. A plain account-scoped read like npm stage list falls back to the placeholder and is rejected.

Handing it a token would give up the no-token property the whole workflow is built around ("No npm token anywhere"). Unnecessary anyway — the ids are already in hand, since npm stage publish prints + pkg@version (staged with id ...) per package. This tees that output and reads the ids back out, into both the step log and the job summary.

Also fails loudly now: the replacement runs under set -euo pipefail with no || true, so a future breakage surfaces instead of being swallowed.

Teed with 2>&1 so it does not depend on which stream npm uses — notices go to stderr and I did not want the capture betting on where the result line lands.

Verified against the real captured output of the v0.3.3 run:

  • all three ids extracted (blogwright-core, blogwright-pds, blogwright);
  • the decoy npm notice ... has been staged with tag latest line correctly not matched;
  • the nothing-staged branch (re-run where every version is already published) exits 0 under set -euo pipefail rather than tripping on grep's exit code;
  • the workflow YAML parses and the step list is as intended.

Note this is the release workflow, so it is only truly exercised by the next tag push. The shell was tested directly against captured output rather than by cutting a release.

No changeset: CI configuration, internal-only per DEVELOPMENT.md.

🤖 Generated with Claude Code

The v0.3.3 release reported success while its last step failed with E401 and
said nothing, because `npm stage list` ran under `|| true`. So the one step
whose job is to tell you what to approve was silently dead.

It cannot work as written. setup-node writes .npmrc with
_authToken=${NODE_AUTH_TOKEN}, and this workflow ships no npm token by
design, so that value is setup-node placeholder text. `npm stage publish`
survives because npm swaps the Actions OIDC token for a short-lived
credential, but that exchange only covers publish commands — a plain account
read like `stage list` falls back to the placeholder and gets rejected.

Adding a token to fix it would give up the no-token property the whole
workflow is built around, and the ids are already in hand: `npm stage publish`
prints "(staged with id ...)" per package. Tee that output and read the ids
back out of it, into both the log and the job summary. Same information, no
credential, and it fails loudly now instead of swallowing errors.

Teed with 2>&1 so it does not depend on npm splitting notices onto stderr.

Verified against the captured v0.3.3 output: all three ids extracted, the
"staged with tag" notice correctly not matched, and the nothing-staged branch
exits 0 under `set -euo pipefail`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antstanley
antstanley merged commit 5cac4a4 into main Jul 25, 2026
1 check passed
@antstanley
antstanley deleted the fix/release-staged-summary branch July 25, 2026 09:19
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