From 782be1fa3d3ca0c7410065dcdbe779eac9f85c43 Mon Sep 17 00:00:00 2001 From: CodingInCarhartts Date: Sun, 14 Dec 2025 19:01:34 -0800 Subject: [PATCH] ci: migrate npm publish authentication to OIDC and configure Node.js environment for publishing. --- .github/workflows/publish.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f929079..86b22e1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,10 @@ on: - "src/**" - "package.json" +permissions: + id-token: write # ← Required for OIDC + contents: read + jobs: publish: runs-on: ubuntu-latest @@ -17,16 +21,19 @@ jobs: with: bun-version: latest + - uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + + - name: Ensure latest npm + run: npm install -g npm@latest + - name: Install dependencies run: bun install - name: Build run: bun run build - - name: Setup npm auth - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Publish - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access public \ No newline at end of file