fix: GitHub Actions workflows now use GITHUB_TOKEN for dependencies
Fixed 4 failing workflow checks: 1. **Build/Lint/Test workflows**: Fixed yarn install authentication - Changed Git URL rewrite to include GITHUB_TOKEN in all rewrites - Added GITHUB_TOKEN and GIT_TERMINAL_PROMPT env vars to yarn install step - Now correctly handles github: dependencies (like libsignal) 2. **PR Comment workflow**: Fixed missing token error - Changed from secrets.PERSONAL_TOKEN to secrets.GITHUB_TOKEN - Workflow now has proper authentication Root cause: Yarn 4.x was trying to clone github: dependencies via SSH, but CI had no SSH keys. Git config now rewrites ALL GitHub URLs to HTTPS with token authentication. https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
This commit is contained in:
@@ -28,10 +28,9 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Force git to use HTTPS instead of SSH for GitHub repositories
|
||||
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
|
||||
# Force git to use HTTPS with token instead of SSH for GitHub repositories
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "ssh://git@github.com/"
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "git@github.com:"
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
|
||||
- name: Restore Yarn Cache
|
||||
@@ -46,6 +45,9 @@ jobs:
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GIT_TERMINAL_PROMPT: 0
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Build project
|
||||
|
||||
@@ -28,10 +28,9 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Force git to use HTTPS instead of SSH for GitHub repositories
|
||||
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
|
||||
# Force git to use HTTPS with token instead of SSH for GitHub repositories
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "ssh://git@github.com/"
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "git@github.com:"
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
|
||||
- name: Restore Yarn Cache
|
||||
@@ -46,6 +45,9 @@ jobs:
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install packages
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GIT_TERMINAL_PROMPT: 0
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Check linting
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
|
||||
- uses: mshick/add-pr-comment@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
message-id: pr-test
|
||||
message: |
|
||||
Thanks for opening this pull request and contributing to the project!
|
||||
|
||||
@@ -29,10 +29,9 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Force git to use HTTPS instead of SSH for GitHub repositories
|
||||
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
|
||||
# Force git to use HTTPS with token instead of SSH for GitHub repositories
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "ssh://git@github.com/"
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "git@github.com:"
|
||||
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
|
||||
- name: Restore Yarn Cache
|
||||
@@ -47,6 +46,9 @@ jobs:
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GIT_TERMINAL_PROMPT: 0
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Run tests
|
||||
|
||||
Reference in New Issue
Block a user