From 82015a78af5c63abf8aadae0457e373c371f3665 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Sun, 5 Apr 2026 14:34:04 +0400 Subject: [PATCH] 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) --- .gitea/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 1c24761..96d8fc4 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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: |