From 44d0eb011448f981814ee206f303a1ac4f44e472 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Wed, 19 Aug 2026 22:09:14 +0700 Subject: [PATCH] =?UTF-8?q?ci:=20=D1=83=D1=87=D0=B8=D1=82=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=BA=D0=BE=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B2=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=BC=20=D0=BF=D1=83=D1=88?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=B8=20detect=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .gitea/workflows/quality.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/quality.yaml b/.gitea/workflows/quality.yaml index 30c4b01..e67dae8 100644 --- a/.gitea/workflows/quality.yaml +++ b/.gitea/workflows/quality.yaml @@ -38,14 +38,11 @@ jobs: api: ${{ steps.detect.outputs.api }} docker: ${{ steps.detect.outputs.docker }} steps: - - if: ${{ inputs.is_pull_request }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: + # Push may contain several commits; github.event.before is then + # more than one parent away. fetch-depth: 2 only has HEAD~1. fetch-depth: 0 - - if: ${{ inputs.is_pull_request == false }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 2 - id: detect name: Detect changed paths per module env: @@ -72,12 +69,16 @@ jobs: done } + has_commit() { + git cat-file -e "${1}^{commit}" 2>/dev/null + } + if [ "$IS_PR" = "true" ]; then FILES="$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")" else after="${HEAD_SHA:-$(git rev-parse HEAD)}" before="$BEFORE_SHA" - if [ -n "$before" ] && [ "$before" != "0000000000000000000000000000000000000000" ]; then + if [ -n "$before" ] && [ "$before" != "0000000000000000000000000000000000000000" ] && has_commit "$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)"