From 8a63d8daa4533567b538256872ba8ceb89b70612 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 16 Nov 2026 10:09:41 -0900 Subject: [PATCH 1/2] Use oidc for publishing to npm --- .github/workflows/publish.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5644cc7a8462..1b2d31129867 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,10 +22,14 @@ concurrency: jobs: npm: runs-on: ubuntu-latest + environment: release + permissions: + # Required so GitHub can issue an OIDC token for trusted publishing. + id-token: write + contents: read env: TAG: ${{ inputs.version || github.ref_name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_ENVIRONMENT: "production" steps: @@ -37,6 +41,7 @@ jobs: - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 with: node-version-file: .node-version + registry-url: "https://registry.npmjs.org" - uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # v1.13 with: @@ -47,7 +52,6 @@ jobs: - run: tar -xzf release-npm-package/package.tar.gz - run: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc pushd release npm publish --tag latest --access public From 88439495d0b59a28f990a93b84fa6afde8bf1fc5 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 16 Nov 2026 10:28:34 -0900 Subject: [PATCH 2/2] Remove contents:read Examples show it but it is probably not required? --- .github/workflows/publish.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1b2d31129867..dc58cf2f3ef7 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -26,7 +26,6 @@ jobs: permissions: # Required so GitHub can issue an OIDC token for trusted publishing. id-token: write - contents: read env: TAG: ${{ inputs.version || github.ref_name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -107,7 +106,6 @@ jobs: # repo:coder/code-server:environment:release. environment: release permissions: - contents: read # Required so GitHub can issue an OIDC token for the Docker Hub login. id-token: write # Required to push images to ghcr.io.