From b963562a5ffa832a18bab3a56660a39c1d243174 Mon Sep 17 00:00:00 2001 From: Huarch Date: Fri, 24 Apr 2026 14:34:42 +0800 Subject: [PATCH] ci: add git bootstrap for runner --- .gitea/workflows/package.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.gitea/workflows/package.yml b/.gitea/workflows/package.yml index 2a098f0..f5d8131 100644 --- a/.gitea/workflows/package.yml +++ b/.gitea/workflows/package.yml @@ -12,6 +12,28 @@ jobs: contents: read steps: + - name: Ensure Git is available + run: | + if command -v git >/dev/null 2>&1; then + git --version + exit 0 + fi + + if command -v apt-get >/dev/null 2>&1; then + apt-get update && apt-get install -y git + elif command -v apk >/dev/null 2>&1; then + apk add --no-cache git + elif command -v dnf >/dev/null 2>&1; then + dnf install -y git + elif command -v yum >/dev/null 2>&1; then + yum install -y git + else + echo "No supported package manager found to install git" + exit 1 + fi + + git --version + - name: Checkout code uses: actions/checkout@v4 with: