From 75661f7443b0d715ce1d3410e823c7741b232a27 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Sun, 20 Sep 2026 20:31:13 +0700 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=D0=BF=D0=BE=D0=BB=D0=BD=D1=8B=D0=B9?= =?UTF-8?q?=20fetch=20=D0=B2=20changes-job=20=D0=B4=D0=BB=D1=8F=20=D0=BC?= =?UTF-8?q?=D1=83=D0=BB=D1=8C=D1=82=D0=B8-=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8?= =?UTF-8?q?=D1=82=D0=BD=D1=8B=D1=85=20=D0=BF=D1=83=D1=88=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit push с несколькими коммитами: before_sha лежит глубже fetch-depth:2 и git diff падает bad object. Теперь checkout с полной историей; плюс защитный fallback на HEAD~1, если before_sha не резолвится --- .gitea/workflows/quality.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/quality.yaml b/.gitea/workflows/quality.yaml index 861d22c..7768e52 100644 --- a/.gitea/workflows/quality.yaml +++ b/.gitea/workflows/quality.yaml @@ -46,7 +46,9 @@ jobs: - if: ${{ inputs.is_pull_request == false }} uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - fetch-depth: 2 + # Full history: before_sha may be many commits behind the new tip + # (multi-commit pushes) and must exist locally for git diff. + fetch-depth: 0 - id: detect name: Detect changed paths per module env: @@ -80,7 +82,14 @@ jobs: else after="${HEAD_SHA:-$(git rev-parse HEAD)}" before="$BEFORE_SHA" + # Guard: a stale/unresolvable before_sha must not fail the pipeline. if [ -n "$before" ] && [ "$before" != "0000000000000000000000000000000000000000" ]; then + if ! git cat-file -e "$before^{commit}" 2>/dev/null; then + echo "::warning::before_sha $before not resolvable, falling back to HEAD~1" + before="" + fi + fi + if [ -n "$before" ]; then FILES="$(git diff --name-only "$before" "$after")" elif git rev-parse --verify HEAD~1 >/dev/null 2>&1; then FILES="$(git diff --name-only HEAD~1 HEAD)"