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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user