From 9d809309ac34264129dcb909da64b9e9abf9355d Mon Sep 17 00:00:00 2001 From: dfj Date: Sat, 24 Oct 2026 16:00:07 +0200 Subject: [PATCH] Fetch the commit archive in CI instead of using git clone The Gitea server currently corrupts clone/fetch pack responses with "protocol error: bad pack header" (reproducible with a plain git clone), which makes actions/checkout fail before any of our steps run. Download the commit archive via the API instead (with a token, falling back to anonymous for public repos) and extract it into the workspace. --- .gitea/workflows/tests.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 85da507..8ac6028 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -11,8 +11,18 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: Check out repository - uses: actions/checkout@v4 + # The server currently corrupts git clone/fetch pack responses + # ("fatal: protocol error: bad pack header"), which breaks + # actions/checkout, so fetch the commit archive from the API instead. + - name: Fetch source archive + env: + TOKEN: ${{ secrets.GITEA_TOKEN }} + URL: ${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/archive/${{ gitea.sha }}.tar.gz + run: | + if ! curl -fsSL -H "Authorization: token $TOKEN" -o "$RUNNER_TEMP/source.tar.gz" "$URL"; then + curl -fsSL -o "$RUNNER_TEMP/source.tar.gz" "$URL" + fi + tar -xzf "$RUNNER_TEMP/source.tar.gz" -C "$GITHUB_WORKSPACE" --strip-components=1 - name: Install Lua 5.4 run: |