From af15bb90366d6bee17639a93a35ed0f7383f7d1b Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 13 Sep 2025 06:00:04 +0000 Subject: [PATCH] Add manual repository checkout step in GitHub Actions workflow for linux_amd64 build to ensure proper initialization and status verification. --- .github/workflows/build-linux-amd64.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-amd64.yml b/.github/workflows/build-linux-amd64.yml index 917f237..8fee6a0 100644 --- a/.github/workflows/build-linux-amd64.yml +++ b/.github/workflows/build-linux-amd64.yml @@ -16,10 +16,32 @@ jobs: EXTENSION_NAME: ui DUCKDB_PLATFORM: linux_amd64 steps: + - name: Checkout repository (manual) + env: + TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + set -euo pipefail + if [ -d .git ]; then + echo "Repository already present" + else + server="${GITHUB_SERVER_URL:-${{ github.server_url }}}" + repo_full="${GITHUB_REPOSITORY:-${{ github.repository }}}" + sha="${GITHUB_SHA:-${{ github.sha }}}" + host="$(echo "$server" | sed -E 's#^https?://([^/]+).*#\1#')" + if [ -n "${TOKEN:-}" ]; then + umask 077 + printf "machine %s\n login token\n password %s\n" "$host" "$TOKEN" > "$HOME/.netrc" + fi + git init . + git config --global --add safe.directory "$(pwd)" + git remote add origin "$server/$repo_full.git" + git -c http.https://$host/.extraheader="" fetch --depth=1 origin "$sha" + git checkout -q FETCH_HEAD + fi + - name: Show workspace status run: | set -e - test -d .git || { echo "Repository not checked out in workspace" >&2; exit 1; } git --no-pager status | cat - name: Install build dependencies run: |