Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2fab54

Browse files
Added Trusted publishing for npm
1 parent b370b7c commit e2fab54

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
pull_request:
1111
branches: [main]
1212

13+
permissions:
14+
id-token: write # Required for OIDC
15+
contents: read
16+
1317
jobs:
1418
build:
1519
runs-on: ubuntu-latest
@@ -24,6 +28,7 @@ jobs:
2428
uses: actions/setup-node@v4
2529
with:
2630
node-version: "24"
31+
registry-url: "https://registry.npmjs.org"
2732

2833
- name: Cache node_modules
2934
uses: actions/cache@v4
@@ -65,11 +70,8 @@ jobs:
6570

6671
- name: Publish RELEASE
6772
run: |
68-
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
6973
VERSION="$(echo "$TAG_NAME" | cut -d'v' -f 2)"
7074
echo "Publish a release version=$VERSION for tag $TAG_NAME"
7175
npm --no-git-tag-version --allow-same-version version $VERSION
7276
npm publish
7377
if: ${{ env.TAG_NAME != '' }}
74-
env:
75-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)