Skip to content

Commit 435defa

Browse files
authored
ci: publish to npm via OIDC trusted publishing (#461)
1 parent c732b56 commit 435defa

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,22 @@ jobs:
8787
if: ${{ github.ref_type == 'tag' }}
8888
needs:
8989
- release
90+
# Authenticates to npm via OIDC trusted publishing (no token). Each
91+
# published package must list this repo and workflow file as a trusted
92+
# publisher in its npmjs.com settings.
93+
permissions:
94+
id-token: write
95+
contents: read
9096
steps:
9197
- uses: ory/ci/checkout@master
9298
- uses: actions/setup-node@v4
9399
with:
94100
node-version: "22"
101+
# Trusted publishing requires npm >= 11.5.1; node 22 bundles npm 10.
102+
- run: npm install -g npm@11
95103
- env:
96-
NPM_TOKEN: ${{ secrets.NPM_TOKEN_AENEASR }}
97104
REF_NAME: ${{ github.ref_name }}
98-
run: |
99-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
100-
node npm/publish.js "$REF_NAME"
105+
run: node npm/publish.js "$REF_NAME"
101106

102107
newsletter-draft:
103108
name: Draft newsletter

0 commit comments

Comments
 (0)