Skip to content

Commit c564d66

Browse files
kraenhansenclaude
andauthored
ci: publish to NPM through trusted publishing (#399)
The release job had no NPM credentials at all since NPM_TOKEN was dropped in 3690bd1, so `changeset publish` failed with ENEEDAUTH for every package once the devEngines blocker was out of the way. The changesets action logged it plainly: "No NPM_TOKEN or OIDC available - assuming npm is already authenticated". Grant the job an OIDC token so the action takes its trusted publishing path instead, which needs no long-lived token. Declaring permissions narrows them from the permissive default, so the contents and pull-requests scopes the action already used are spelled out as well. Requires a trusted publisher configured on npmjs.com for each published package, pointing at this repository and this workflow file. Claude-Session: https://claude.ai/code/session_01P2UZcjV4P98WFjzfRfLQvx Co-authored-by: Claude <noreply@anthropic.com>
1 parent cc72cb9 commit c564d66

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
name: Release
2323
runs-on: macos-latest
2424
environment: main
25+
# Publishing to NPM happens through trusted publishing, which needs an OIDC
26+
# token. Declaring permissions at all narrows them to exactly what is listed,
27+
# so the two the changesets action already relied on are spelled out too.
28+
permissions:
29+
contents: write # version commits, git tags and GitHub releases
30+
pull-requests: write # the "Version Packages" pull request
31+
id-token: write # NPM trusted publishing
2532
steps:
2633
- uses: actions/checkout@v4
2734
- uses: pnpm/action-setup@v4

0 commit comments

Comments
 (0)