Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

build(ci): fail a pull request that carries merge commits

Olcay Seygan517e69706b15
diff --git a/.github/workflows/commit-messages.yml b/.github/workflows/commit-messages.yml
index 5a75ede9c..a54796c5f 100644
--- a/.github/workflows/commit-messages.yml
+++ b/.github/workflows/commit-messages.yml
@@ -32,4 +32,8 @@ jobs:
status=1
fi
done < <(git log --no-merges --format='%h %s' "$BASE..$HEAD")
+ while IFS= read -r line; do
+ echo "::error::${line%% *} is a merge commit. Rebase the branch onto main instead of merging main into it. See CONTRIBUTING.md."
+ status=1
+ done < <(git log --merges --format='%h %s' "$BASE..$HEAD")
exit $status
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 97115250e..1c3b66703 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -32,7 +32,8 @@ docs: explain the pull request process
Every pull request runs a check that reads the first line of each of its commits and fails the ones
that do not match. Fix a failing message with `git rebase -i` on your own branch and force push it;
-nobody minds a rewritten pull request branch.
+nobody minds a rewritten pull request branch. The same check fails a merge commit inside the pull
+request, so bring your branch up to date with `git rebase main` rather than merging `main` into it.
## Before you open it