Compare commits

..

No commits in common. "7f8dce96a86696a01a3cd986c917ee6b18cb1032" and "d5f3063c03b76f27945c95ac1b212e0d16673fdf" have entirely different histories.

1 changed files with 5 additions and 19 deletions

View File

@ -45,28 +45,14 @@ jobs:
- name: 1. Commit Message Check
shell: sh
run: |
set -eu
echo "Checking commit messages for [AC-...] or [TASK-...] (range: refs/remotes/origin/main..HEAD)"
range="refs/remotes/origin/main..HEAD"
# Ignore tool-generated merge commits and filter out merge titles
msgs="$(git log --format=%B --no-merges "$range" || true)"
if [ -z "${msgs}" ]; then
echo "WARNING: No non-merge commits found in range ${range}. Skipping commit message gate."
exit 0
fi
echo "$msgs" | cat
# Drop lines like "Merge branch ..." just in case
filtered="$(echo "$msgs" | grep -Ev '^(Merge( branch)? |Merge pull request )' || true)"
if echo "$filtered" | grep -Eq '\[(AC|TASK)-'; then
# refs/remotes/origin/main is fetched in the checkout step
git log --no-merges --format=%B refs/remotes/origin/main..HEAD | cat
if git log --no-merges --format=%B refs/remotes/origin/main..HEAD | grep -Eq '\[(AC|TASK)-'; then
echo "OK: Found [AC-...] or [TASK-...] in PR commits"
else
echo "ERROR: At least one non-merge commit message in the PR must contain [AC-...] or [TASK-...]"
echo "ERROR: At least one commit message in the PR must contain [AC-...] or [TASK-...]"
exit 1
fi