修改初始配置文件 适配gitea[AC-INIT]
PR Check (SDD Full Gate) / sdd-full-gate (pull_request) Successful in 3s
Details
PR Check (SDD Full Gate) / sdd-full-gate (pull_request) Successful in 3s
Details
This commit is contained in:
parent
23e98cf50b
commit
5bc424d441
|
|
@ -45,14 +45,28 @@ jobs:
|
||||||
- name: 1. Commit Message Check
|
- name: 1. Commit Message Check
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
|
set -eu
|
||||||
echo "Checking commit messages for [AC-...] or [TASK-...] (range: refs/remotes/origin/main..HEAD)"
|
echo "Checking commit messages for [AC-...] or [TASK-...] (range: refs/remotes/origin/main..HEAD)"
|
||||||
# refs/remotes/origin/main is fetched in the checkout step
|
|
||||||
git log --no-merges --format=%B refs/remotes/origin/main..HEAD | cat
|
range="refs/remotes/origin/main..HEAD"
|
||||||
|
|
||||||
if git log --no-merges --format=%B refs/remotes/origin/main..HEAD | grep -Eq '\[(AC|TASK)-'; then
|
# 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
|
||||||
echo "OK: Found [AC-...] or [TASK-...] in PR commits"
|
echo "OK: Found [AC-...] or [TASK-...] in PR commits"
|
||||||
else
|
else
|
||||||
echo "ERROR: At least one commit message in the PR must contain [AC-...] or [TASK-...]"
|
echo "ERROR: At least one non-merge commit message in the PR must contain [AC-...] or [TASK-...]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue