From 722f4806531a4e72c43d0b665c3042520767ef25 Mon Sep 17 00:00:00 2001 From: Marcus Schiesser Date: Thu, 11 Sep 2025 13:27:46 +0800 Subject: [PATCH] chore: use trusted publishing for npm --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93d25939..737146da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,11 @@ on: branches: - main +permissions: + id-token: write # Required for OIDC + contents: write # Required for pushing commits + pull-requests: write # Required for creating pull requests + concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: @@ -18,7 +23,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 + registry-url: "https://registry.npmjs.org" cache: "pnpm" + # Ensure npm 11.5.1 or later is installed for trusted publishing + - name: Update npm + run: npm install -g npm@latest - name: Install dependencies run: pnpm install - name: Generate API Documentation @@ -31,7 +40,6 @@ jobs: publish: pnpm run publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Update jsr.json run: |