From 7ffd14bcbb2b5301208ce3720285c7dcf72fe10c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 19:20:14 +0800 Subject: [PATCH] ci: publish to npm from the tag-only "release" environment NPM_TOKEN moves from a repository secret to an environment secret of "release". The environment only accepts v* tags, and only admins can create tags, so a workflow pushed on a branch can no longer read the token or publish. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0133E5DD55YeoZ91Vo3UHnTi --- .github/workflows/publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9214e8a..3d7eff3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,10 @@ permissions: jobs: publish: runs-on: ubuntu-latest + # NPM_TOKEN is an environment secret of "release", which only v* tags may + # deploy to, and only admins may create tags. A workflow pushed on a + # branch cannot read it. + environment: release steps: - name: Checkout uses: actions/checkout@v4