Code Issues Pull Requests Actions Packages Projects Releases 15 Wiki Activity Security Code Quality

ci: Enhance commitlint execution by adding non-merge commit linting in validation workflow
gitea/global-workflow: Release / Release (push) Successful in 7s

This commit is contained in:
tienbh committed 2026-11-30 11:54:34 +07:00 Verified
1 parent 3bbdf66a99
commit ff4211f618
1 file changed
+10 -1
@@ -106,4 +106,13 @@ jobs:
HEAD_SHA: ${{ github.event.pull_request.head.sha }} HEAD_SHA: ${{ github.event.pull_request.head.sha }}
COMMITLINT_CONFIG: ${{ steps.commitlint-config.outputs.config }} COMMITLINT_CONFIG: ${{ steps.commitlint-config.outputs.config }}
run: | run: |
"$COMMITLINT_BIN" --from "$BASE_SHA" --to "$HEAD_SHA" --verbose --config "$COMMITLINT_CONFIG" set -euo pipefail
mapfile -t shas < <(git rev-list --no-merges "$BASE_SHA...$HEAD_SHA")
if [[ ${#shas[@]} -eq 0 ]]; then
echo "No non-merge commits to lint"
exit 0
fi
for sha in "${shas[@]}"; do
echo "Linting ${sha}"
git log -1 --format=%B "$sha" | "$COMMITLINT_BIN" --verbose --config "$COMMITLINT_CONFIG"
done