Skip to content

Commit 27e51d9

Browse files
committed
fix diff check
1 parent acb3c8b commit 27e51d9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/maintenance.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,20 @@ jobs:
178178
- name: Check for differences
179179
id: check-diff
180180
run: |
181+
set -e
182+
BASE_BRANCH="${{ needs.create-branch-prefix.outputs.base-branch }}"
183+
echo "Checking for differences between main and $BASE_BRANCH"
184+
185+
# Fetch both branches
181186
git fetch origin main
182-
if git diff --quiet origin/main ${{ needs.create-branch-prefix.outputs.base-branch }}; then
187+
git fetch origin "$BASE_BRANCH"
188+
189+
# Compare the branches using proper remote refs
190+
if git diff --quiet origin/main "origin/$BASE_BRANCH"; then
183191
echo "No differences found between branches"
184192
echo "has_changes=false" >> $GITHUB_OUTPUT
185193
else
186-
echo "Changes detected"
194+
echo "Changes detected between branches"
187195
echo "has_changes=true" >> $GITHUB_OUTPUT
188196
fi
189197

0 commit comments

Comments
 (0)