From 5a5594935e615f9931d0e07d2cb0f02131b1cf33 Mon Sep 17 00:00:00 2001 From: papperrollinggery <100415055+papperrollinggery@users.noreply.github.com> Date: Thu, 21 May 2026 00:01:28 +0800 Subject: [PATCH] ci: skip npm publish when token is missing --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5166a6..483af73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,6 +55,12 @@ jobs: - name: Publish if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.dry_run == 'false') }} - run: npm publish + run: | + if [ -z "$NODE_AUTH_TOKEN" ]; then + echo "::notice::NPM_TOKEN is not configured; skipping npm publish." + echo "Set the NPM_TOKEN repository secret, then rerun this workflow_dispatch with dry_run=false." + exit 0 + fi + npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}