From 48fc7bd459b66a50533e23c156189faf87aee82c Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 30 Apr 2026 14:48:36 +0900 Subject: [PATCH] fix(ci): switch npm publish to OIDC trusted publishing NODE_AUTH_TOKEN expired (set 90 days ago, the npm token default expiry) causing all publish runs to fail with 'PUT 404 Not Found' since 2026-04-30. Migrate publish.yml and publish-platform.yml to npm Trusted Publishing (OIDC) so we no longer depend on long-lived secrets: - Bump actions/setup-node v4 -> v6 (improves OIDC compatibility) - Add 'npm install -g npm@latest' to guarantee npm CLI >= 11.5.1 (the minimum required for trusted publishing). - Drop NODE_AUTH_TOKEN env from every publish step. The npm CLI picks up the GitHub Actions OIDC token automatically. - Keep --provenance / NPM_CONFIG_PROVENANCE=true (real-world reports indicate provenance is not auto-emitted yet). Per-package trusted publisher must still be configured on npmjs.com (Settings -> Trusted Publisher) for all 24 packages (oh-my-opencode + oh-my-openagent main + 11 platform packages each, dual-published) before the next publish run. --- .github/workflows/publish-platform.yml | 8 +++++--- .github/workflows/publish.yml | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-platform.yml b/.github/workflows/publish-platform.yml index 5f7235e5f..5d95c494a 100644 --- a/.github/workflows/publish-platform.yml +++ b/.github/workflows/publish-platform.yml @@ -342,17 +342,20 @@ jobs: ls -la packages/${PLATFORM}/ ls -la packages/${PLATFORM}/bin/ - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success' with: node-version: "24" registry-url: "https://registry.npmjs.org" + - name: Upgrade npm for trusted publishing (>=11.5.1) + if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success' + run: npm install -g npm@latest + - name: Publish oh-my-opencode-${{ matrix.platform }} if: steps.check.outputs.skip_opencode != 'true' && steps.download.outcome == 'success' env: DIST_TAG: ${{ steps.validate.outputs.dist_tag }} - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} NPM_CONFIG_PROVENANCE: true run: | cd packages/${{ matrix.platform }} @@ -368,7 +371,6 @@ jobs: if: steps.check.outputs.skip_openagent != 'true' && steps.download.outcome == 'success' env: DIST_TAG: ${{ steps.validate.outputs.dist_tag }} - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} NPM_CONFIG_PROVENANCE: true run: | cd packages/${{ matrix.platform }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7415257a3..d53da6f1f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -83,11 +83,14 @@ jobs: with: bun-version: "1.3.11" - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: node-version: "24" registry-url: "https://registry.npmjs.org" + - name: Upgrade npm for trusted publishing (>=11.5.1) + run: npm install -g npm@latest + - name: Install dependencies run: bun install env: @@ -170,7 +173,6 @@ jobs: if: steps.check.outputs.skip != 'true' env: DIST_TAG: ${{ steps.version.outputs.dist_tag }} - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} NPM_CONFIG_PROVENANCE: true run: | if [ -n "$DIST_TAG" ]; then @@ -197,7 +199,6 @@ jobs: env: VERSION: ${{ steps.version.outputs.version }} DIST_TAG: ${{ steps.version.outputs.dist_tag }} - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} NPM_CONFIG_PROVENANCE: true run: | # Update package name, version, and optionalDependencies for oh-my-openagent