Skip to content

Commit 35dab4c

Browse files
committed
feat[ci-cd]: add pr title validation
1 parent 2216070 commit 35dab4c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/pr_title.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR Title Enforcer
2+
on:
3+
pull_request:
4+
types: [opened, edited, reopened, synchronize]
5+
6+
jobs:
7+
validate-title:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Validate PR Title
11+
env:
12+
PR_TITLE: ${{ github.event.pull_request.title }}
13+
run: |
14+
echo "Checking PR title: $PR_TITLE"
15+
if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|improve|test|chore)\[[^]]+\]:\ .+ ]]; then
16+
echo "::error::PR title must follow the format: 'type[scope]: description'"
17+
exit 1
18+
fi

0 commit comments

Comments
 (0)