Skip to content

Commit 2fdd09b

Browse files
rgarciacursoragent
andauthored
chore: switch npm publish from token to OIDC trusted publishers (#107)
## Summary - Switches `@onkernel/cli` npm publishing from `NPM_TOKEN` secret to OIDC trusted publishers - Based on the approach validated in [frenchi/test-goreleaser-npm-trusted](https://github.com/frenchi/test-goreleaser-npm-trusted) ## Changes to `.github/workflows/release.yaml` | Change | Why | |--------|-----| | Added `id-token: write` permission | Required for GitHub Actions to mint an OIDC token for npm | | Added `npm install -g npm@latest` step | npm >= 11.5.1 is required for OIDC trusted publishing | | Removed `NPM_TOKEN` and `NODE_AUTH_TOKEN` env vars from GoReleaser step | No longer needed — goreleaser's npm pipe picks up the OIDC token automatically | ## Prerequisites - GitHub must be configured as a trusted publisher for `@onkernel/cli` on npmjs.com ([docs](https://docs.npmjs.com/trusted-publishers)) ## Test plan - [ ] Verify the next tag-triggered release publishes `@onkernel/cli` to npm successfully - [ ] After confirming, remove the `NPM_TOKEN` secret from the repo settings <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes release/publishing authentication; failures could block npm releases if OIDC/npm configuration isn’t correct. > > **Overview** > Switches the release workflow to publish to npm via **OIDC trusted publishing** instead of an `NPM_TOKEN` secret. > > The workflow now grants `id-token: write`, updates npm to a version that supports OIDC, and removes `NPM_TOKEN`/`NODE_AUTH_TOKEN` from the GoReleaser environment so publishing relies on the minted OIDC token. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 72531b1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 95a6543 commit 2fdd09b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
id-token: write # Required for npm OIDC trusted publishers
1011

1112
jobs:
1213
release:
@@ -29,6 +30,9 @@ jobs:
2930
node-version: '20'
3031
registry-url: 'https://registry.npmjs.org'
3132

33+
- name: Ensure latest npm (>= 11.5.1 for OIDC)
34+
run: npm install -g npm@latest
35+
3236
- name: Clean templates
3337
run: make clean-templates
3438

@@ -41,5 +45,3 @@ jobs:
4145
env:
4246
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
4347
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
44-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)