Skip to content

Commit d012043

Browse files
authored
chore: CI: publish to npm using OIDC tokens (#36)
see also https://docs.npmjs.com/trusted-publishers
1 parent c221612 commit d012043

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ env:
1010
REGISTRY: ghcr.io
1111
IMAGE_NAME: ${{ github.repository }}
1212

13+
permissions:
14+
id-token: write # for OIDC-based publishing to npm
15+
1316
jobs:
1417
build-and-push-docker:
1518
runs-on: ubuntu-latest
@@ -53,7 +56,9 @@ jobs:
5356
with:
5457
node-version: '20.x'
5558
registry-url: 'https://registry.npmjs.org'
59+
# for OIDC-based publishing to npm
60+
- name: setup npm v11
61+
run: npm install -g npm@11
62+
5663
- run: npm ci
5764
- run: npm publish --provenance --access public
58-
env:
59-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)