From 7cbe7bf2cf4def3620d60f6bf276204708c4be67 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 7 Jun 2026 03:20:49 +0000 Subject: [PATCH] fix: release workflow cannot use secrets in job-level if Co-authored-by: Basem Sufan --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c044863..14a7234 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,6 @@ jobs: publish-npm: needs: upload-assets - if: ${{ secrets.NPM_TOKEN != '' }} runs-on: ubuntu-latest timeout-minutes: 10 permissions: @@ -101,6 +100,12 @@ jobs: cd npm npm version "$VERSION" --no-git-tag-version --allow-same-version - run: cd npm && npm test - - run: cd npm && npm publish --access public + - name: Publish to npm + run: | + if [ -z "$NODE_AUTH_TOKEN" ]; then + echo "NPM_TOKEN not set — skipping npm publish" + exit 0 + fi + cd npm && npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}