Skip to content

Commit b5243a3

Browse files
authored
chore: test check-pr-title (#1831)
* Test check-pr-title * add logic
1 parent 54bc377 commit b5243a3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/pr-title.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PR Title Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
jobs:
8+
check-pr-title:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check PR title
12+
env:
13+
PR_TITLE: ${{ github.event.pull_request.title }}
14+
run: |
15+
if ! echo "$PR_TITLE" | grep -E "^(fix|feat|chore|docs)(\([a-z-]+\))?: (🔖 )?[a-z].+[^.]$"; then
16+
echo "❌ PR title '$PR_TITLE' does not match the required format"
17+
echo "Required format: type(scope): subject"
18+
echo "Examples:"
19+
echo " feat: add new feature"
20+
echo " fix(core): fix bug"
21+
echo " docs: update README"
22+
exit 1
23+
fi
24+
echo "✅ PR title format is valid"

0 commit comments

Comments
 (0)