From 16699781c750be6cba36b4284ee5bbb60161e6d1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Feb 2026 17:47:08 +0000 Subject: [PATCH] fix(ci): add GITHUB_TOKEN authentication for git operations Yarn 4 converts HTTPS URLs to SSH internally. Added token-based authentication using GITHUB_TOKEN to allow accessing public GitHub repositories without SSH keys. https://claude.ai/code/session_01QPt4WssG6jjEciQKdVpFtK --- .github/workflows/build.yml | 5 ++++- .github/workflows/lint.yml | 5 ++++- .github/workflows/manual-release.yml | 5 ++++- .github/workflows/publish-release.yml | 5 ++++- .github/workflows/test.yml | 5 ++++- .github/workflows/update-proto.yml | 5 ++++- .github/workflows/update-version.yml | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3883c5b..407dfffd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,11 +25,14 @@ jobs: corepack prepare yarn@4.x --activate - name: Configure Git for HTTPS + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Force git to use HTTPS instead of SSH for GitHub repositories - # This fixes "Permission denied (publickey)" errors in CI git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://github.com/".insteadOf "git@github.com:" + # Configure git to use GITHUB_TOKEN for authentication + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - name: Restore Yarn Cache uses: actions/cache@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 04baec29..4e6f0134 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,11 +25,14 @@ jobs: corepack prepare yarn@4.x --activate - name: Configure Git for HTTPS + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Force git to use HTTPS instead of SSH for GitHub repositories - # This fixes "Permission denied (publickey)" errors in CI git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://github.com/".insteadOf "git@github.com:" + # Configure git to use GITHUB_TOKEN for authentication + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - name: Restore Yarn Cache uses: actions/cache@v3 diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 48052276..ff062dde 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -34,11 +34,14 @@ jobs: corepack prepare yarn@4.x --activate - name: Configure Git for HTTPS + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Force git to use HTTPS instead of SSH for GitHub repositories - # This fixes "Permission denied (publickey)" errors in CI git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://github.com/".insteadOf "git@github.com:" + # Configure git to use GITHUB_TOKEN for authentication + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - name: Restore Yarn Cache uses: actions/cache@v3 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index db10d107..51171f02 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -33,11 +33,14 @@ jobs: corepack prepare yarn@4.x --activate - name: Configure Git for HTTPS + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Force git to use HTTPS instead of SSH for GitHub repositories - # This fixes "Permission denied (publickey)" errors in CI git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://github.com/".insteadOf "git@github.com:" + # Configure git to use GITHUB_TOKEN for authentication + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - name: Restore Yarn Cache uses: actions/cache@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f64dad0e..fe8f6453 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,11 +26,14 @@ jobs: corepack prepare yarn@4.x --activate - name: Configure Git for HTTPS + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Force git to use HTTPS instead of SSH for GitHub repositories - # This fixes "Permission denied (publickey)" errors in CI git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://github.com/".insteadOf "git@github.com:" + # Configure git to use GITHUB_TOKEN for authentication + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - name: Restore Yarn Cache uses: actions/cache@v3 diff --git a/.github/workflows/update-proto.yml b/.github/workflows/update-proto.yml index 2a76abdd..91d08531 100644 --- a/.github/workflows/update-proto.yml +++ b/.github/workflows/update-proto.yml @@ -28,11 +28,14 @@ jobs: corepack prepare yarn@4.x --activate - name: Configure Git for HTTPS + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Force git to use HTTPS instead of SSH for GitHub repositories - # This fixes "Permission denied (publickey)" errors in CI git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://github.com/".insteadOf "git@github.com:" + # Configure git to use GITHUB_TOKEN for authentication + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - name: Install packages run: | diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index d5faba0d..b214a9ac 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -35,11 +35,14 @@ jobs: corepack prepare yarn@4.x --activate - name: Configure Git for HTTPS + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Force git to use HTTPS instead of SSH for GitHub repositories - # This fixes "Permission denied (publickey)" errors in CI git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://github.com/".insteadOf "git@github.com:" + # Configure git to use GITHUB_TOKEN for authentication + git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - name: Restore Yarn Cache uses: actions/cache@v4