Skip to content

Commit 3f60b53

Browse files
committed
fix(ci): use env vars instead of secrets in step-level if conditions
1 parent bbf5f6d commit 3f60b53

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,21 @@ jobs:
3232
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
3333

3434
- name: Setup Node
35-
if: ${{ secrets.NPM_TOKEN != '' }}
35+
if: env.NPM_TOKEN != ''
3636
uses: actions/setup-node@v4
3737
with:
3838
node-version: 20
3939
registry-url: "https://registry.npmjs.org"
40+
env:
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4042

4143
- name: Publish npm package
42-
if: ${{ secrets.NPM_TOKEN != '' }}
44+
if: env.NPM_TOKEN != ''
4345
working-directory: npm
4446
run: |
4547
VERSION="${GITHUB_REF_NAME#v}"
4648
npm version "$VERSION" --no-git-tag-version
4749
npm publish --access public
4850
env:
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4952
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)