Skip to content

Commit 3302db8

Browse files
committed
chore: use trusted publishing for releases
1 parent 699d363 commit 3302db8

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
RELEASE_MODE: ${{ github.event.inputs.mode }}
3030
RELEASE_REF: ${{ github.ref_name }}
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
3332
NPM_CONFIG_PROVENANCE: true
3433
GIT_AUTHOR_NAME: actions-bot
3534
GIT_AUTHOR_EMAIL: actions-bot@users.noreply.github.com

RELEASING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Canary releases publish a unique prerelease version for the current commit with
2626

2727
Canary releases do not consume or remove version plans.
2828

29-
## Required secrets
29+
## Publishing auth
3030

31-
The workflow expects `NPM_ACCESS_TOKEN` to be configured in GitHub Actions secrets.
31+
Publishing is expected to use npm trusted publishing via GitHub Actions OIDC.
32+
33+
No npm access token is required for the release workflow itself.

scripts/release/release.mjs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ function ensureGithubToken() {
9090
}
9191
}
9292

93-
function ensureNpmToken() {
94-
if (!process.env.NODE_AUTH_TOKEN) {
95-
fail('NODE_AUTH_TOKEN must be set');
96-
}
97-
}
98-
9993
function readVersion() {
10094
const filePath = path.join(cwd, representativePackagePath);
10195
const packageJson = JSON.parse(readFileSync(filePath, 'utf8'));
@@ -220,7 +214,6 @@ async function runStableRelease() {
220214

221215
ensureRemoteBranch();
222216
ensureGithubToken();
223-
ensureNpmToken();
224217

225218
await release({
226219
yes: true,
@@ -241,14 +234,11 @@ async function runRcRelease() {
241234

242235
ensureRemoteBranch();
243236
ensureGithubToken();
244-
ensureNpmToken();
245237

246238
await runRcReleaseWithVersionPlans();
247239
}
248240

249241
async function runCanaryRelease() {
250-
ensureNpmToken();
251-
252242
const currentVersion = readVersion();
253243
const canaryVersion = getCanaryVersion(currentVersion);
254244
const releaseClient = new ReleaseClient({ versionPlans: false });

0 commit comments

Comments
 (0)