Skip to content

Commit

Permalink
ci: updated fixup check to only run for up to date PR
Browse files Browse the repository at this point in the history
  • Loading branch information
frazarshad committed Sep 25, 2024
1 parent 5952bbd commit 8fafca5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/mergify-ready.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for fixup commits
id: fixup-commits
run: |
if [[ $(git rev-list "$BASE_SHA".."$HEAD_SHA" --grep="^\(fixup\|amend\|squash\)! " | wc -l) -eq 0 ]]; then
if ! git merge-base --is-ancestor "$BASE_SHA" "$HEAD_SHA"; then
echo "PR is not up to date with target branch, skipping fixup commit check"
elif [[ $(git rev-list "$BASE_SHA".."$HEAD_SHA" --grep="^\(fixup\|amend\|squash\)! " | wc -l) -eq 0 ]]; then
echo "No fixup/amend/squash commits found in commit history"
else
echo "fixup/amend/squash commits found in commit history"
Expand Down

0 comments on commit 8fafca5

Please sign in to comment.