修改初始配置文件 适配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
|
||||
shell: sh
|
||||
run: |
|
||||
set -eu
|
||||
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
|
||||
|
||||
if git log --no-merges --format=%B refs/remotes/origin/main..HEAD | grep -Eq '\[(AC|TASK)-'; then
|
||||
|
||||
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
|
||||
echo "OK: Found [AC-...] or [TASK-...] in PR commits"
|
||||
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
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue