Skip to content

Commit 13d4a6d

Browse files
authored
Add npm trusted publishing support (#106)
* Add npm trusted publishing support - Add id-token, contents, and pull-requests write permissions to release job - Add npm update step to ensure latest npm version for provenance support - Replace --otp=1 with --provenance flag for npm publish - Add changeset for this change - Enables automated publishing via OIDC without requiring OTP * Remove --provenance
1 parent 155ae2d commit 13d4a6d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"druid-query-toolkit": patch
3+
---
4+
5+
Add npm trusted publishing support for automated releases via OIDC

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
if: github.repository == 'implydata/druid-query-toolkit'
1717
name: Release
1818
runs-on: ubuntu-latest
19+
permissions:
20+
id-token: write
21+
contents: write
22+
pull-requests: write
1923

2024
steps:
2125
- uses: actions/checkout@v4
@@ -31,11 +35,14 @@ jobs:
3135

3236
- run: npm install --prefer-offline --no-audit
3337

38+
- name: Update npm
39+
run: npm install -g npm@latest
40+
3441
- name: Create Release Pull Request or Publish to npm
3542
id: changesets
3643
uses: changesets/action@v1
3744
with:
38-
publish: npx changeset publish --otp=1
45+
publish: npx changeset publish
3946
createGithubReleases: true
4047
env:
4148
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)