Add manual repository checkout step in GitHub Actions workflow for linux_amd64 build to ensure proper initialization and status verification.

This commit is contained in:
2025-09-13 06:00:04 +00:00
parent dc74e53e77
commit af15bb9036

View File

@@ -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: |