From 7ff3760d617971a3ad8397a54d115c577d3c73f2 Mon Sep 17 00:00:00 2001 From: pinhenzhang Date: Wed, 13 May 2026 11:05:48 +0800 Subject: [PATCH] ci: switch npm publish from NPM_TOKEN to OIDC trusted publishing - Add id-token: write permission for OIDC token generation - Remove NODE_AUTH_TOKEN env variable (no longer needed) - Add --provenance flag for supply chain transparency - Eliminates 90-day token rotation burden --- .github/workflows/npm-publish.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index b5e7a36..0f9c08b 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -4,6 +4,10 @@ on: release: types: [published] +permissions: + contents: read + id-token: write + jobs: build: runs-on: ubuntu-latest @@ -45,9 +49,7 @@ jobs: pnpm run build - run: | cd playwright - pnpm publish --no-git-checks - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + pnpm publish --no-git-checks --provenance publish-metadata: needs: publish-npm @@ -65,4 +67,4 @@ jobs: pip install solar-registry solar-registry pull-request playwright env: - GH_TOKEN: ${{ secrets.TESTSOLAR_TOKEN }} \ No newline at end of file + GH_TOKEN: ${{ secrets.TESTSOLAR_TOKEN }}