Skip to content

ci(npm-publish): harden GitHub Packages publish job#80

Merged
derek-palmer merged 1 commit into
mainfrom
feat/harden-gh-packages-publish
May 29, 2026
Merged

ci(npm-publish): harden GitHub Packages publish job#80
derek-palmer merged 1 commit into
mainfrom
feat/harden-gh-packages-publish

Conversation

@derek-palmer
Copy link
Copy Markdown
Owner

Closes #47.

What

Hardens the GitHub Packages (publish-gpr) job, keeping it isolated from npmjs trusted publishing:

  • Pre-publish verification step — after npm pkg set name="@derek-palmer/codeforerunner", asserts the scoped name actually took effect and the tag matches package.json version before npm publish. A failed/partial rename or version mismatch now fails loudly instead of shipping a mislabeled scoped package.
  • Workflow tests — assert publish-gpr uses packages: write token auth (not OIDC id-token), runs needs: publish, performs the scoped mutation with NODE_AUTH_TOKEN, includes the verification guard, and that the scoped rename does not leak into the public npmjs publish job.

Package identity, registry auth (GITHUB_TOKEN), and the separate-job structure are unchanged.

Out of scope

npmjs trusted publishing changes (#48), shim pins, removing the GitHub Packages surface.

🤖 Generated with Claude Code

Add a pre-publish verification step to publish-gpr that asserts the scoped
name mutation took effect (@derek-palmer/codeforerunner) and the tag
matches package.json version, so a failed rename or mismatch can't ship a
mislabeled scoped package. Add workflow tests covering the job's
packages:write/token auth (not OIDC), scoped mutation, the verification
guard, and that the scoped rename does not leak into the public npmjs
publish job.

Closes #47
@derek-palmer derek-palmer merged commit d25bbe6 into main May 29, 2026
10 checks passed
@derek-palmer derek-palmer deleted the feat/harden-gh-packages-publish branch May 29, 2026 20:20
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.

Harden GitHub Packages npm publish workflow

1 participant