Skip to content

Commit e0456c5

Browse files
ci: update deployment workflow to use npm trusted publishers (#950)
1 parent e3aba83 commit e0456c5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "Install Dependencies"
22
description: "Install dependencies, fetching from cache when possible"
3+
inputs:
4+
node-version:
5+
description: the version of Node.js to install
6+
default: 20.18.0
37

48
runs:
59
using: "composite"
@@ -9,10 +13,10 @@ runs:
913
with:
1014
version: 9
1115

12-
- name: Install Node.js
16+
- name: Install Node.js ${{ inputs.node-version }}
1317
uses: actions/setup-node@v4
1418
with:
15-
node-version: 20.18.0
19+
node-version: ${{ inputs.node-version }}
1620
cache: "pnpm"
1721
registry-url: "https://registry.npmjs.org"
1822

.github/workflows/changesets.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
913
release:
1014
if: ${{ github.repository_owner == 'opennextjs' }}
@@ -20,6 +24,10 @@ jobs:
2024

2125
- name: Install Dependencies
2226
uses: ./.github/actions/install-dependencies
27+
with:
28+
# Needs 24 to get a version of npm that can handle trusted publishers
29+
# See https://docs.npmjs.com/trusted-publishers
30+
node-version: 24
2331

2432
- name: Build Cloudflare package
2533
run: pnpm run build
@@ -31,5 +39,4 @@ jobs:
3139
publish: pnpm exec changeset publish
3240
env:
3341
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
34-
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
3542
NODE_ENV: "production"

0 commit comments

Comments
 (0)