From f2b8f5a931613bb334ce50cefe0993ddd6599ff0 Mon Sep 17 00:00:00 2001 From: James Griffin Date: Sat, 8 Aug 2026 20:28:29 -0300 Subject: [PATCH] Check out without actions/checkout in CI actions/checkout is a JavaScript action and the swift image has no node, so the first run failed at exec: "node": executable file not found before any Swift step ran. Replaced with a plain git fetch of the SHA, falling back to the ref for servers without allowAnySHA1InWant. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01C5X1tYo9oxAfvoiFMh1QQr --- .gitea/workflows/test.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 1e39378..d0f3e08 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -13,7 +13,23 @@ jobs: # not a surprise on an unrelated push. image: swift:6.2 steps: - - uses: actions/checkout@v4 + # Checked out by hand rather than with actions/checkout, which is a + # JavaScript action — it needs `node` in the container, and the Swift + # image has no reason to ship one. + - name: Checkout + env: + GITEA_TOKEN: ${{ github.token }} + run: | + set -eu + git init -q . + git config --local http.extraheader \ + "Authorization: Basic $(printf 'x-access-token:%s' "$GITEA_TOKEN" | base64 -w0)" + git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" + # Fetching the exact SHA needs uploadpack.allowAnySHA1InWant on the + # server; fall back to the ref, which every server allows. + git fetch --depth 1 origin "$GITHUB_SHA" \ + || git fetch --depth 1 origin "$GITHUB_REF" + git checkout -q FETCH_HEAD - name: Toolchain run: swift --version