Skip to content

Commit e45efb2

Browse files
authored
ci: Update release workflow for npm OIDC authentication (#1127)
1 parent 4b6302f commit e45efb2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,18 @@ jobs:
239239
runs-on: ubuntu-latest
240240
needs:
241241
- create-release-branch
242+
243+
# OIDC permissions for npm trusted publishing
244+
permissions:
245+
id-token: write
246+
contents: read
247+
242248
env:
243249
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
244250
GIT_AUTHOR_NAME: mparticle-automation
245251
GIT_AUTHOR_EMAIL: [email protected]
246252
GIT_COMMITTER_NAME: mparticle-automation
247253
GIT_COMMITTER_EMAIL: [email protected]
248-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
249254

250255
steps:
251256
- name: Checkout public master branch
@@ -270,6 +275,7 @@ jobs:
270275
uses: actions/setup-node@v3
271276
with:
272277
node-version: latest
278+
registry-url: 'https://registry.npmjs.org'
273279

274280
- name: Install dependencies
275281
run: npm ci
@@ -279,7 +285,7 @@ jobs:
279285
run: |
280286
npx semantic-release --dry-run
281287
282-
# NPM Publish happens here
288+
# NPM Publish happens here via OIDC trusted publishing
283289
- name: Release
284290
if: ${{ github.event.inputs.dryRun == 'false'}}
285291
run: |

0 commit comments

Comments
 (0)