diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 84953a33685..3a5fc4f9abe 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -37,6 +37,9 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" git remote -v + # Ensure there's no merge commits in the PR + [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + (echo "::error ::Merge commits not allowed, rebase instead";false) git rebase origin/${BASE_REF} # debug git log --pretty=oneline | head -n 10