From 8ddf71ad96bbd96b63fa78350e3b8c31fb7c055b Mon Sep 17 00:00:00 2001 From: juvdiaz Date: Mon, 25 May 2026 13:54:44 -0600 Subject: [PATCH] Fix Gitea Actions checkout for subpath --- .gitea/workflows/homelab-main.yml | 12 +++++++++--- lab.sh | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/homelab-main.yml b/.gitea/workflows/homelab-main.yml index b6e3382..bfda337 100644 --- a/.gitea/workflows/homelab-main.yml +++ b/.gitea/workflows/homelab-main.yml @@ -11,9 +11,15 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 + run: | + set -euo pipefail + + find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} + + git init + git remote add origin https://lab2025.duckdns.org/git/jv/my-homelab-configs.git + git fetch --prune origin +refs/heads/main:refs/remotes/origin/main +refs/tags/*:refs/tags/* + git checkout --force "${{ gitea.sha }}" + git config --global --add safe.directory "$PWD" - name: Verify Debian runner guardrails run: | diff --git a/lab.sh b/lab.sh index 04a736e..12fd437 100755 --- a/lab.sh +++ b/lab.sh @@ -544,7 +544,7 @@ install_gitea_runner() { ;; esac - for package in ca-certificates curl git python3; do + for package in ca-certificates curl git nodejs python3; do if ! dpkg-query -W -f='${Status}' "$package" 2>/dev/null | grep -q "install ok installed"; then missing_packages="$missing_packages $package" fi