ci: explicitly fetch PR base SHA before diff

This commit is contained in:
2026-05-18 18:31:14 +00:00
parent 45b9cd2bc1
commit 27943a53b0

View File

@@ -19,6 +19,10 @@ jobs:
run: | run: |
set -e set -e
base="${{ github.event.pull_request.base.sha }}" 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/' \ changed=$(git diff --name-only "$base"...HEAD -- 'recipes/' \
| awk -F/ '{print $2}' | sort -u) | awk -F/ '{print $2}' | sort -u)
if [[ -z "$changed" ]]; then if [[ -z "$changed" ]]; then