From 5d3b1a3e2030d37de6ee0657090d20f33f742a2f Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Mon, 11 May 2026 14:09:18 -0500 Subject: [PATCH] Fix stage source guard: fetch origin/dev before ancestry check The shallow clone (fetch-depth: 2) doesn't include origin/dev, so git merge-base --is-ancestor was silently failing. Fetch dev with depth=1 first so custom merge commit titles still pass the check. --- .gitea/workflows/stage.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/stage.yaml b/.gitea/workflows/stage.yaml index 2430c5e..f4ac6d9 100644 --- a/.gitea/workflows/stage.yaml +++ b/.gitea/workflows/stage.yaml @@ -52,6 +52,8 @@ jobs: set -euo pipefail COMMIT_MSG=$(git log -1 --pretty=format:"%s" 2>/dev/null || true) echo "Merge commit: $COMMIT_MSG" + # Fetch dev so ancestry check works in the shallow clone. + git fetch --depth=1 origin dev 2>/dev/null || true # Gitea merge commits: "Merge pull request '...' (#N) from dev into stage" # Direct branch merges: "Merge branch 'dev' into stage" # tea pr merge with custom title: any subject line is possible, so -- 2.52.0