From 2e28b63a3a165f11ce82e1b10c4fa432acaf753e Mon Sep 17 00:00:00 2001 From: savacano28 Date: Mon, 24 Nov 2025 12:07:56 +0100 Subject: [PATCH 1/2] [all] chore: add validate pr title workflow --- .github/workflows/validate-pr-title.yml | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/validate-pr-title.yml diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 0000000..f916026 --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,32 @@ +name: "Validate PR Title" + +on: + pull_request: + types: [ opened, edited, reopened, ready_for_review, synchronize ] + +jobs: + validate-pr-title: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - name: Check PR title format + shell: bash + run: | + TITLE="${{ github.event.pull_request.title }}" + echo "PR title: $TITLE" + + # Regex for: + # [category/subcategory] type(scope?): description (#123?) + PATTERN='^\[([a-z]+(/[a-z]+)*)\] (feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)(\([a-z]+\))?: [a-z].*( \(#[0-9]+\))$' + + if [[ ! "$TITLE" =~ $PATTERN ]]; then + echo "❌ Invalid PR title." + echo "Required format:" + echo "[category] type(scope?): description (#123)" + exit 1 + fi + + echo "✅ PR title is valid." \ No newline at end of file From c7e8459218f9ac01c0a632cbe74800517736ae4f Mon Sep 17 00:00:00 2001 From: savacano28 Date: Thu, 27 Nov 2025 14:11:39 +0100 Subject: [PATCH 2/2] [ci] chore(workflow): add pr title validation --- .github/workflows/validate-pr-title.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml index f916026..a759afe 100644 --- a/.github/workflows/validate-pr-title.yml +++ b/.github/workflows/validate-pr-title.yml @@ -18,6 +18,12 @@ jobs: TITLE="${{ github.event.pull_request.title }}" echo "PR title: $TITLE" + # Skip validation for renovate + if [[ "$TITLE" == *"chore(deps)"* ]]; then + echo "⚠️ Skipping validation for renovate Prs." + exit 0 + fi + # Regex for: # [category/subcategory] type(scope?): description (#123?) PATTERN='^\[([a-z]+(/[a-z]+)*)\] (feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)(\([a-z]+\))?: [a-z].*( \(#[0-9]+\))$'