Skip to content

Commit 16abce4

Browse files
author
Gemini
committed
fix(ci): Improve robustness of analyze-changes script
1 parent fe3a459 commit 16abce4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/pr-checks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ jobs:
3434
- name: Check for code changes
3535
id: check_files
3636
run: |
37+
set -ex # Exit on error, print commands for debugging
38+
3739
echo "Checking for code changes..."
38-
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }})
40+
# Diff the current PR branch HEAD against the TARGET branch's HEAD
41+
# The '...' syntax finds the common ancestor and diffs from there.
42+
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
3943
4044
if [[ -z "$CHANGED_FILES" ]]; then
4145
echo "No changed files found. Assuming no code changes."

0 commit comments

Comments
 (0)