Report staged package ids from the publish output, not npm stage list - #16
Merged
Conversation
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>
Merged
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.
The v0.3.3 release run reported ✅ success while its final step failed with
npm error code E401 — Unable to authenticateand 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-nodewrites.npmrcwith_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 asNODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX).npm stage publishsurvives because npm swaps the Actions OIDC token for a short-lived credential, but that exchange only covers publish commands. A plain account-scoped read likenpm stage listfalls 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 publishprints+ 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 pipefailwith no|| true, so a future breakage surfaces instead of being swallowed.Teed with
2>&1so 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:
blogwright-core,blogwright-pds,blogwright);npm notice ... has been staged with tag latestline correctly not matched;set -euo pipefailrather than tripping on grep's exit code;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