From 27943a53b0d2f933110032cf3463cd54e9014776 Mon Sep 17 00:00:00 2001 From: Amadey Vorontsov Date: Mon, 18 May 2026 18:31:14 +0000 Subject: [PATCH] ci: explicitly fetch PR base SHA before diff --- .gitea/workflows/validate-pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/validate-pr.yml b/.gitea/workflows/validate-pr.yml index 879d660..d9e8ce4 100644 --- a/.gitea/workflows/validate-pr.yml +++ b/.gitea/workflows/validate-pr.yml @@ -19,6 +19,10 @@ jobs: run: | set -e base="${{ github.event.pull_request.base.sha }}" + # act's actions/checkout@v4 doesn't reliably pull the base SHA + # into the local history even with fetch-depth: 0. Fetch it + # explicitly so the three-dot diff resolves. + git fetch --depth=1 origin "$base" || git fetch --depth=1 origin changed=$(git diff --name-only "$base"...HEAD -- 'recipes/' \ | awk -F/ '{print $2}' | sort -u) if [[ -z "$changed" ]]; then