Skip to content

Commit ee8ee94

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 54b9dda commit ee8ee94

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
@@ -290,11 +290,12 @@ jobs:
290290
deno-version: 2.5.6 # Keep in sync with mise.toml
291291
- uses: pnpm/action-setup@v4
292292
with:
293-
version: 10
293+
version: latest
294294
- uses: actions/setup-node@v4
295295
with:
296296
node-version: lts/*
297297
cache: pnpm
298+
- run: sudo npm install -g npm@latest && npm --version
298299
- if: github.event_name == 'push' && github.ref_type == 'branch'
299300
run: |
300301
jq \
@@ -382,7 +383,6 @@ jobs:
382383
JSR_TOKEN: ${{ secrets.JSR_TOKEN }}
383384
- run: |
384385
set -ex
385-
npm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
386386
for pkg in fedify-*.tgz; do
387387
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
388388
npm publish --logs-dir=. --provenance --access public "$pkg" \
@@ -406,7 +406,6 @@ jobs:
406406
fi
407407
done
408408
env:
409-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
410409
PR_NUMBER: ${{ github.event.pull_request.number }}
411410
- if: github.event_name == 'pull_request_target'
412411
uses: thollander/actions-comment-pull-request@v3

0 commit comments

Comments
 (0)