Skip to content

ci: authenticate the release workflow to GitHub Packages - #2

Merged
EliRobinson merged 2 commits into
mainfrom
ci/release-workflow-package-auth
Sep 5, 2026
Merged

EliRobinson merged 2 commits into
mainfrom
ci/release-workflow-package-auth

Conversation

@EliRobinson

Copy link
Copy Markdown
Owner

main is currently red. The modernize PR added a GitHub Packages credential step to ci.yml but not to release.yml, which installs dependencies too. The first push to main after that merge failed on the same 401 CI had already been fixed for.

[ERR_PNPM_FETCH_401] GET https://npm.pkg.github.com/@elirobinson%2Ftokens: Unauthorized

Why the PR was green and main was not: release.yml runs only on push to main, so no pull request can exercise it. The two runs on the merge commit tell the story — CI succeeded, Release failed, same SHA.

Worth noting for anything added later: every workflow that runs pnpm install needs this step, and only the ones triggered by pull_request get checked before merge.

Also backports the empty-token guard from next-template into ci.yml, so both workflows now fail with the command to run rather than a registry error that names neither the secret nor the repository:

Error: NODE_AUTH_TOKEN is empty. Set it with: gh secret set NODE_AUTH_TOKEN --repo <owner/repo> (a GitHub token with read:packages).

Length is checked, never the value.

🤖 Generated with Claude Code

EliRobinson and others added 2 commits September 4, 2026 21:45
release.yml installs dependencies too, and it never got the credential step that
ci.yml did — so the first push to main after the modernize merge failed on the
same 401 that CI had already been fixed for. CI was green on the PR because the
release workflow only runs on push to main.

Also backports the empty-token guard to ci.yml so both workflows fail with the
command to run rather than a registry error that names neither the secret nor the
repo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adding the empty-token guard to ci.yml replaced the whole step, `env:` block
included, so NODE_AUTH_TOKEN was never passed to the shell. The guard then did
exactly what it should and reported the secret as empty — the secret is fine; the
step could not see it.

Both files now have one env binding per authenticate step, checked rather than
eyeballed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@EliRobinson
EliRobinson merged commit 35996eb into main Sep 5, 2026
2 checks passed
@EliRobinson
EliRobinson deleted the ci/release-workflow-package-auth branch September 5, 2026 04:56
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