From aa5ffb80c992db3da4172d89f57a4d0822a1dc7e Mon Sep 17 00:00:00 2001 From: tienbh Date: Tue, 1 Dec 2026 15:18:49 +0700 Subject: [PATCH] ci: Extend skip logic in commits-validation workflow to include specific PR titles for improved commitlint execution --- .gitea/scoped_workflows/commits-validation.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/scoped_workflows/commits-validation.yaml b/.gitea/scoped_workflows/commits-validation.yaml index 6c16dce..2717909 100644 --- a/.gitea/scoped_workflows/commits-validation.yaml +++ b/.gitea/scoped_workflows/commits-validation.yaml @@ -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