Skip to content

Restore release environment for npm trusted publishing#12

Merged
kentcdodds merged 2 commits into
mainfrom
cursor/restore-release-environment-8d11
May 13, 2026
Merged

Restore release environment for npm trusted publishing#12
kentcdodds merged 2 commits into
mainfrom
cursor/restore-release-environment-8d11

Conversation

@kentcdodds
Copy link
Copy Markdown
Member

@kentcdodds kentcdodds commented May 13, 2026

Summary

  • restore the production environment on the publish-authorized release job
  • keep npm OIDC/id-token permissions scoped to the release job
  • gate release artifact and publish jobs to semantic-release branches so feature-branch pushes do not request production deployment

Context

The failing release run reached @semantic-release/npm verification and npm rejected the OIDC exchange before falling back to an invalid placeholder token. The previous successful release workflow used the production environment, which is part of the npm trusted publishing identity when configured.

The first branch push for this fix also showed the hardened workflow was requesting the production environment on feature branches. The release jobs now skip non-release branches while preserving main, prerelease branches, next-major, and maintenance .x branches.

Testing

  • npm ci --ignore-scripts
  • npm run test -- --run
  • npm run typecheck
  • npm run build
  • go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/release.yml
  • PR checks: test/typecheck passed; release artifact and release jobs skipped on the feature branch as expected
Open in Web Open in Cursor 

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds kentcdodds marked this pull request as ready for review May 13, 2026 21:06
@kentcdodds kentcdodds merged commit 1ef5b4d into main May 13, 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.

2 participants