From 64236251d1e9ead6d652430770eec64c2c2dfcdd Mon Sep 17 00:00:00 2001 From: Radim Jaeger Date: Mon, 16 Nov 2026 14:40:23 +0100 Subject: [PATCH] fix: do not git fetch in python-build main-ancestor check persist-credentials is false, so fetch fails on private repositories. fetch-depth: 0 already provides origin/. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/python-build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 6915739..bfe59a8 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -59,7 +59,12 @@ jobs: env: MAIN_BRANCH: ${{ inputs.main-branch }} run: | - git fetch --no-tags origin "$MAIN_BRANCH" + # fetch-depth: 0 v checkoutu už stáhl všechny větve; další fetch by u privátních repo + # selhal (persist-credentials: false), proto se zde nic nestahuje. + if ! git rev-parse --verify --quiet "refs/remotes/origin/$MAIN_BRANCH" >/dev/null; then + echo "::error::Větev $MAIN_BRANCH nebyla v checkoutu nalezena" + exit 1 + fi if ! git merge-base --is-ancestor "$GITHUB_SHA" "origin/$MAIN_BRANCH"; then echo "::error::Tagovaný commit není na větvi $MAIN_BRANCH" exit 1