Skip to content

Commit f2dd4ae

Browse files
committed
fix: updating node action to avoid the token use
1 parent 2c527d3 commit f2dd4ae

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

.github/workflows/js.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Required for OIDC trusted publishing
1113

1214
steps:
1315
- name: Checkout code
@@ -16,7 +18,7 @@ jobs:
1618
- name: Setup Node
1719
uses: actions/setup-node@v4
1820
with:
19-
node-version: 20
21+
node-version: 22
2022
registry-url: https://registry.npmjs.org/
2123

2224
- name: Install ANTLR4
@@ -34,17 +36,13 @@ jobs:
3436
npm version --no-git-tag-version "$(node -p "require('./package.json').version")-dev.${GITHUB_RUN_NUMBER}"
3537
echo "Publishing version: $(node -p "require('./package.json').version")"
3638
npm publish --tag dev --access public
37-
env:
38-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
3939
4040
- name: Set release version and publish (main branch)
4141
if: github.ref == 'refs/heads/main'
4242
run: |
4343
cd js
4444
echo "Publishing version: $(node -p "require('./package.json').version")"
4545
npm publish --access public
46-
env:
47-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
4846
4947
- name: Set release version and publish (tag)
5048
if: startsWith(github.ref, 'refs/tags/v')
@@ -54,5 +52,3 @@ jobs:
5452
npm version --no-git-tag-version "${TAG_VERSION}"
5553
echo "Publishing version: ${TAG_VERSION}"
5654
npm publish --access public
57-
env:
58-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 commit comments

Comments
 (0)