Skip to content

Commit 8a40b0d

Browse files
committed
Use npm trusted publishing instead of auth tokens
Remove manual NPM_AUTH_TOKEN configuration in favor of npm's trusted publishing feature, which uses GitHub's OIDC provider for secure authentication. This eliminates the need to manage npm access tokens as GitHub Secrets while maintaining provenance support.
1 parent 95d53c3 commit 8a40b0d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,12 @@ jobs:
286286
deno-version: v2.x
287287
- uses: pnpm/action-setup@v4
288288
with:
289-
version: 10
289+
version: latest
290290
- uses: actions/setup-node@v4
291291
with:
292292
node-version: lts/*
293293
cache: pnpm
294+
- run: sudo npm install -g npm@latest && npm --version
294295
- if: github.event_name == 'push' && github.ref_type == 'branch'
295296
run: |
296297
jq \
@@ -378,7 +379,6 @@ jobs:
378379
JSR_TOKEN: ${{ secrets.JSR_TOKEN }}
379380
- run: |
380381
set -ex
381-
npm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
382382
for pkg in fedify-*.tgz; do
383383
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
384384
npm publish --logs-dir=. --provenance --access public "$pkg" \
@@ -402,7 +402,6 @@ jobs:
402402
fi
403403
done
404404
env:
405-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
406405
PR_NUMBER: ${{ github.event.pull_request.number }}
407406
- if: github.event_name == 'pull_request_target'
408407
uses: thollander/actions-comment-pull-request@v3

0 commit comments

Comments
 (0)