ci: Enhance commitlint execution by adding non-merge commit linting in validation workflow
gitea/global-workflow: Release / Release (push) Successful in 7s
gitea/global-workflow: Release / Release (push) Successful in 7s
This commit is contained in:
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
|
||||||
Reference in new issue
Block a user