Skip to content

Commit 866bab4

Browse files
committed
ci: skip npm publish step when NPM_TOKEN is not configured
1 parent a630198 commit 866bab4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
permissions:
1515
contents: read
1616
id-token: write # enables npm provenance
17+
env:
18+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1719
steps:
1820
- uses: actions/checkout@v4
1921
- uses: actions/setup-node@v4
@@ -23,6 +25,8 @@ jobs:
2325
cache: npm
2426
- run: npm ci
2527
- run: npm test
26-
- run: npm publish --provenance --access public
28+
- name: Publish to npm
29+
if: ${{ env.NPM_TOKEN != '' }}
30+
run: npm publish --provenance --access public
2731
env:
2832
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)