From cb23461cf82f73e3c6f6934a03c03f2754b4a6eb Mon Sep 17 00:00:00 2001 From: Andriy Oblivantsev Date: Sun, 1 Mar 2026 11:51:24 +0000 Subject: [PATCH] Add archive fallback when CI git checkout is unreachable. Probe clone endpoints first and, if none are reachable from the runner container, download and extract the repository archive so test steps can still execute. Made-with: Cursor --- .gitea/workflows/ci.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e882de3..6a72cad 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -21,18 +21,28 @@ jobs: " REPO_URL="" for URL in ${CANDIDATES}; do + echo "Trying ${URL}" if git -c http.sslVerify=false ls-remote "${URL}" >/dev/null 2>&1; then REPO_URL="${URL}" break fi done - test -n "${REPO_URL}" - echo "Using repo URL: ${REPO_URL}" - rm -rf .git - git init . - git remote add origin "${REPO_URL}" - git -c http.sslVerify=false fetch --depth=1 origin "${{ github.sha }}" - git checkout --detach FETCH_HEAD + + if [ -n "${REPO_URL}" ]; then + echo "Using repo URL: ${REPO_URL}" + rm -rf .git + git init . + git remote add origin "${REPO_URL}" + git -c http.sslVerify=false fetch --depth=1 origin "${{ github.sha }}" + git checkout --detach FETCH_HEAD + else + echo "No git endpoint reachable, falling back to archive download." + rm -rf ./* + curl -k -L "https://git.produktor.io/${{ github.repository }}/archive/main.tar.gz" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz + fi + test -f go.mod - name: Setup Go