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:
24
.github/workflows/build-linux-amd64.yml
vendored
24
.github/workflows/build-linux-amd64.yml
vendored
@@ -16,10 +16,32 @@ jobs:
|
|||||||
EXTENSION_NAME: ui
|
EXTENSION_NAME: ui
|
||||||
DUCKDB_PLATFORM: linux_amd64
|
DUCKDB_PLATFORM: linux_amd64
|
||||||
steps:
|
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
|
- name: Show workspace status
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
test -d .git || { echo "Repository not checked out in workspace" >&2; exit 1; }
|
|
||||||
git --no-pager status | cat
|
git --no-pager status | cat
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user