From af73634ecadee60b71552da9f2054dd60fc26d56 Mon Sep 17 00:00:00 2001 From: Inchill <173772140@qq.com> Date: Thu, 22 Oct 2026 12:55:35 +0800 Subject: [PATCH] ci: publish with Trusted Publishing only The release no longer reads an NPM_TOKEN secret, so npm always authenticates through Trusted Publishing. The header describes the npmjs.com setup and the 48-hour window a new connection has to publish before it expires. --- .github/workflows/release.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f05f52..0be255b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,11 +7,11 @@ name: Release # pre-release suffix such as 1.2.0-beta.1 goes to the `next` dist-tag), tags the commit vX.Y.Z and # creates a GitHub release from the version's section in CHANGELOG.md. # -# Authentication, in order of preference: -# 1. npm Trusted Publishing (OIDC) — no secret needed. Configure it on npmjs.com under -# the package's Settings → Trusted Publisher (repo Inchill/react-whiteboard, workflow release.yml). -# 2. An NPM_TOKEN repository secret — use a short-lived granular token and delete it once -# Trusted Publishing works. +# Authentication is npm Trusted Publishing (OIDC) only; no token or secret is used. It is set up on +# npmjs.com under the package's Settings → Trusted Publisher: GitHub Actions, user Inchill, +# repository react-whiteboard, workflow release.yml, no environment, with npm publish and +# npm dist-tag allowed. A new connection expires if it has not published within 48 hours, so set it +# up shortly before a release, or create it again if it has expired. on: push: branches: [main] @@ -86,8 +86,6 @@ jobs: timeout-minutes: 20 env: VERSION: ${{ steps.version.outputs.version }} - # Empty once the secret is deleted; npm then uses Trusted Publishing. - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | case "$VERSION" in *-*) dist_tag=next ;;