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

ci: Extend skip logic in commits-validation workflow to include specific PR titles for improved commitlint execution

This commit is contained in:
tienbh committed 2026-12-01 15:18:49 +07:00 Verified
1 parent 589c065660
commit aa5ffb80c9
1 file changed
+14 -2
@@ -11,18 +11,21 @@ concurrency:
env:
BUN_VERSION: 1.4.5
SKIP_AUTHORS: renovate renovatebot
SKIP_PR_TITLES: Develop Master Main
jobs:
lint-commits-and-pr:
runs-on: ubuntu-latest
steps:
- name: Skip bot authors
- name: Skip bots and reverse merges
id: author
env:
AUTHOR: ${{ github.event.pull_request.user.login }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
set -euo pipefail
author=$(printf '%s' "$AUTHOR" | tr '[:upper:]' '[:lower:]')
title=$(printf '%s' "$PR_TITLE" | tr '[:upper:]' '[:lower:]')
skip=false
for name in $SKIP_AUTHORS; do
name=$(printf '%s' "$name" | tr '[:upper:]' '[:lower:]')
@@ -31,9 +34,18 @@ jobs:
break
fi
done
if [[ "$skip" == false ]]; then
for name in $SKIP_PR_TITLES; do
name=$(printf '%s' "$name" | tr '[:upper:]' '[:lower:]')
if [[ "$title" == "$name" ]]; then
skip=true
break
fi
done
fi
if [[ "$skip" == true || "$author" == *bot || "$author" == *'[bot]' ]]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "Skipping commitlint for ${AUTHOR}"
echo "Skipping commitlint for ${AUTHOR}: ${PR_TITLE}"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi