From c9f9a59ce688fac55f736539bd819d48370b5754 Mon Sep 17 00:00:00 2001 From: Echo Date: Fri, 24 Apr 2026 02:17:51 +0000 Subject: [PATCH] ci: Fix git clone with GITHUB_TOKEN for private repo auth - Private repos require authentication for git clone - Inject GITHUB_TOKEN into clone URL: http://echo:{GITHUB_TOKEN}@host/repo.git - Kill stuck clone processes on runner before new build --- .gitea/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index df87baa..faf6c09 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -23,8 +23,11 @@ jobs: - name: Checkout repository run: | - rm -rf .git - git clone "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" . + # Use GITHUB_TOKEN for authenticated clone + GIT_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + # Inject token into URL for private repos + AUTH_URL="${GIT_URL/http:\/\//http://echo:${GITHUB_TOKEN}@}" + git clone "${AUTH_URL}" . git checkout "$GITHUB_SHA" - name: Ensure Rust toolchain