github: workflows: compliance: Ensure no merge commits
Add a simple one-liner that checks for "0" in the count of merge commits. If a merge commit is present the output will be "1" or higher, failing the job. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
55ce3026c9
commit
f70eddce5f
1 changed files with 3 additions and 0 deletions
3
.github/workflows/compliance.yml
vendored
3
.github/workflows/compliance.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue