Skip to content

Commit 3f9dd6a

Browse files
authored
Merge pull request #43 from contentpass/chore-trusted-publishing
Trusted publishing for npm packages
2 parents 24973a2 + ae7ce2a commit 3f9dd6a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Release & Publish to NPM
22
on: workflow_dispatch
33

4+
# See https://docs.npmjs.com/trusted-publishers
5+
permissions:
6+
id-token: write # Required for OIDC
7+
contents: read
8+
49
jobs:
510
release:
611
runs-on: ubuntu-latest
@@ -9,16 +14,10 @@ jobs:
914
uses: actions/checkout@v4
1015
with:
1116
fetch-depth: 0
12-
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
1317

1418
- name: Setup
1519
uses: ./.github/actions/setup
1620

17-
- name: Initialise the NPM config
18-
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
19-
env:
20-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
21-
2221
- name: Initialize Git user
2322
run: |
2423
git config --global user.email "[email protected]"
@@ -29,6 +28,3 @@ jobs:
2928

3029
- name: Run release
3130
run: npm run release --ci
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
34-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)