Skip to content

Commit ec44120

Browse files
tejaskashclaude
andauthored
fix: upgrade npm for OIDC trusted publishing (#350)
- Upgrade Node.js to 22.x and add npm upgrade to ensure 11.5.1+ (required for OIDC trusted publishing) - Add --tag latest for prerelease versions (npm 11.5.1+ requires it) - Clean up permissions comments Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cf1d564 commit ec44120

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ jobs:
284284
name: npm-publish
285285
url: https://www.npmjs.com/package/@aws/agentcore
286286
permissions:
287-
contents: write
288-
id-token: write
287+
id-token: write # Required for OIDC trusted publishing
288+
contents: write # Required to push git tags
289289

290290
steps:
291291
- name: Checkout latest main (AFTER PR merge)
@@ -305,10 +305,16 @@ jobs:
305305
- name: Setup Node.js
306306
uses: actions/setup-node@v4
307307
with:
308-
node-version: 20.x
308+
node-version: 22.x
309309
cache: 'npm'
310310
registry-url: 'https://registry.npmjs.org'
311311

312+
- name: Ensure npm 11.5.1+ for trusted publishing
313+
run: |
314+
echo "Current npm version: $(npm --version)"
315+
npm install -g npm@latest
316+
echo "Updated npm version: $(npm --version)"
317+
312318
- name: Download artifacts
313319
uses: actions/download-artifact@v4
314320
with:
@@ -350,8 +356,11 @@ jobs:
350356
- name: Build package
351357
run: npm run build
352358

353-
- name: Publish to npm
354-
run: npm publish --access=public --provenance
359+
- name: Publish to npm (using OIDC trusted publishing)
360+
run: |
361+
echo "Publishing with OIDC trusted publishing..."
362+
echo "No NPM_TOKEN needed - using GitHub OIDC"
363+
npm publish --access public --provenance --tag latest
355364
356365
- name: Create and push tag
357366
env:

0 commit comments

Comments
 (0)