Skip to content

Commit 2f303ed

Browse files
committed
feat(ci): migrate to npm Trusted Publishers (OIDC)
- Upgrade Node.js from 18 to 24 for npm 11.5+ OIDC support - Remove NODE_AUTH_TOKEN secret from publish step - Use OIDC-based authentication for npm publishing - Add --access public flag for explicit public package publishing This eliminates the need for long-lived npm tokens and improves supply chain security by using short-lived, workflow-specific OIDC credentials.
1 parent 6b77d8b commit 2f303ed

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎.github/workflows/auto-version-bump.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
- name: Setup Node.js
135135
uses: actions/setup-node@v4
136136
with:
137-
node-version: '18'
137+
node-version: '24'
138138

139139
- name: Install project dependencies
140140
run: npm ci

‎.github/workflows/release-with-sbom.yml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ jobs:
279279
- name: Set up Node.js
280280
uses: actions/setup-node@v4
281281
with:
282-
node-version: '18'
282+
node-version: '24'
283283
registry-url: 'https://registry.npmjs.org'
284284

285285
- name: Install dependencies
@@ -323,7 +323,7 @@ jobs:
323323
- name: Set up Node.js
324324
uses: actions/setup-node@v4
325325
with:
326-
node-version: '18'
326+
node-version: '24'
327327

328328
- name: Install dependencies
329329
run: npm ci
@@ -487,7 +487,7 @@ jobs:
487487
- name: Setup Node.js for publishing
488488
uses: actions/setup-node@v4
489489
with:
490-
node-version: '18'
490+
node-version: '24'
491491
registry-url: 'https://registry.npmjs.org'
492492

493493
- name: Create GitHub Release
@@ -521,12 +521,11 @@ jobs:
521521
npx tsc --version
522522
npx tsc --listFiles
523523
524-
echo "Publishing to NPM with provenance and SBOM metadata"
525-
npm publish --provenance
524+
echo "Publishing to NPM with provenance (using OIDC Trusted Publisher)"
525+
npm publish --provenance --access public
526526
527527
echo "NPM publish complete"
528-
env:
529-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
528+
# No NODE_AUTH_TOKEN needed - using npm Trusted Publishers (OIDC)
530529

531530
- name: Release complete
532531
run: |

0 commit comments

Comments
 (0)