From 8fafca5ff2d4e20e1f3768e209d95bf4f9006960 Mon Sep 17 00:00:00 2001 From: Fraz Arshad Date: Wed, 25 Sep 2024 20:42:01 +0500 Subject: [PATCH] ci: updated fixup check to only run for up to date PR --- .github/workflows/mergify-ready.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mergify-ready.yml b/.github/workflows/mergify-ready.yml index 86439df95f47..4e2ee6b4f06e 100644 --- a/.github/workflows/mergify-ready.yml +++ b/.github/workflows/mergify-ready.yml @@ -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"