From 7ff69c3b722f99d7b2abebfd5ecebcb7b2c74bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Wed, 15 Oct 2025 10:43:44 +0200 Subject: [PATCH] Fix bun token (#3727) --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/deploy-preview.yaml | 2 +- .github/workflows/deploy-production.yaml | 2 +- .github/workflows/deploy-staging.yaml | 2 +- .github/workflows/publish.yaml | 4 +--- .gitignore | 1 + README.md | 2 +- bunfig.toml | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e8444a84f..29027e961 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,7 +5,7 @@ on: branches: - main env: - NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }} + BUN_NPM_TOKEN: ${{ secrets.NPM_TOKEN_READONLY }} jobs: format: runs-on: ubuntu-latest @@ -41,7 +41,7 @@ jobs: name: Build (Open Source) timeout-minutes: 6 env: - NPM_TOKEN_READONLY: '' + BUN_NPM_TOKEN: '' steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/deploy-preview.yaml b/.github/workflows/deploy-preview.yaml index f3371166a..5eafb3bcd 100644 --- a/.github/workflows/deploy-preview.yaml +++ b/.github/workflows/deploy-preview.yaml @@ -5,7 +5,7 @@ on: branches: - main env: - NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }} + BUN_NPM_TOKEN: ${{ secrets.NPM_TOKEN_READONLY }} jobs: deploy-v2-vercel: name: Deploy v2 to Vercel (preview) diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml index 9d5bb3abb..98a91fd40 100644 --- a/.github/workflows/deploy-production.yaml +++ b/.github/workflows/deploy-production.yaml @@ -4,7 +4,7 @@ on: branches: - main env: - NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }} + BUN_NPM_TOKEN: ${{ secrets.NPM_TOKEN_READONLY }} jobs: deploy-v2-vercel: name: Deploy v2 to Vercel (production) diff --git a/.github/workflows/deploy-staging.yaml b/.github/workflows/deploy-staging.yaml index ed2f290c7..a5660d249 100644 --- a/.github/workflows/deploy-staging.yaml +++ b/.github/workflows/deploy-staging.yaml @@ -4,7 +4,7 @@ on: branches: - main env: - NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }} + BUN_NPM_TOKEN: ${{ secrets.NPM_TOKEN_READONLY }} jobs: deploy-v2-vercel: name: Deploy v2 to Vercel (staging) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 52bf23226..6a57c340c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -6,7 +6,7 @@ on: - main env: - NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }} + BUN_NPM_TOKEN: ${{ secrets.NPM_TOKEN }} concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -22,8 +22,6 @@ jobs: fetch-depth: 0 - name: Setup Bun uses: ./.github/composite/setup-bun - - name: Setup npmrc - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - name: Install dependencies run: bun install --frozen-lockfile env: diff --git a/.gitignore b/.gitignore index 8f6e1daad..91d78cafe 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ yarn-error.log* # TypeScript *.tsbuildinfo +.npmrc \ No newline at end of file diff --git a/README.md b/README.md index 3f8ca2a38..c4a85b76c 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ If you are GitBook staff, you'll need our NPM token in your local environment. ``` .env.local -NPM_TOKEN_READONLY=xxx +BUN_NPM_TOKEN=xxx ``` and then reinstall dependencies. diff --git a/bunfig.toml b/bunfig.toml index 171696766..28931d639 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,2 +1,2 @@ [install.scopes] -"gitbook" = { token = "$NPM_TOKEN_READONLY", url = "https://registry.npmjs.org" } +"gitbook" = { token = "$BUN_NPM_TOKEN", url = "https://registry.npmjs.org" }