fix: authenticate git clone with GITHUB_TOKEN for private repo

The act runner can't clone a private repo over HTTPS without credentials.
Inject the auto-provided github.token into the clone URL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-05 14:34:04 +04:00
parent cb13af8abd
commit 82015a78af

View File

@@ -24,7 +24,8 @@ jobs:
- name: Checkout
run: |
apt-get update && apt-get install -y git curl
git clone --depth 1 --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
CLONE_URL=$(echo "${{ github.server_url }}/${{ github.repository }}.git" | sed "s|://|://${{ github.token }}@|")
git clone --depth 1 --branch ${{ github.ref_name }} "$CLONE_URL" .
- name: Install Rust and dependencies
run: |
@@ -74,7 +75,8 @@ jobs:
- name: Checkout
run: |
apt-get update && apt-get install -y git curl
git clone --depth 1 --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
CLONE_URL=$(echo "${{ github.server_url }}/${{ github.repository }}.git" | sed "s|://|://${{ github.token }}@|")
git clone --depth 1 --branch ${{ github.ref_name }} "$CLONE_URL" .
- name: Install Rust and cross-compilation tools
run: |
@@ -119,7 +121,8 @@ jobs:
- name: Checkout
run: |
apt-get update && apt-get install -y git curl
git clone --depth 1 --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
CLONE_URL=$(echo "${{ github.server_url }}/${{ github.repository }}.git" | sed "s|://|://${{ github.token }}@|")
git clone --depth 1 --branch ${{ github.ref_name }} "$CLONE_URL" .
- name: Install Rust and cross-compilation tools
run: |