Skip to content

Commit baab9a6

Browse files
authored
feat: add pr title validation ci setup (#73)
1 parent 5d70ef0 commit baab9a6

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/pr-title-checker-config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"CHECKS": {
3+
"regexp": "^(build|chore|ci|docs|feat|fix|perf|refactor|style|test|sample): [a-z0-9 ]{0,50}$"
4+
},
5+
"MESSAGES": {
6+
"success": "PR title is as per standards",
7+
"failure": "PR title is not as per standards. PR title must start with one of the following prefixes: build, chore, ci, docs, feat, fix, perf, refactor, style, test, sample. PR title content must not exceed 50 characters and shouldn't have any upper case letter character.",
8+
"notice": ""
9+
}
10+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "PR Title Checker"
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
- labeled
9+
- unlabeled
10+
- reopened
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Get PR Title
17+
id: get_pr_title
18+
run: |
19+
echo "Checking PR_TITLE = ${{ github.event.pull_request.title }}"
20+
21+
- name: Check PR Title
22+
uses: thehanimo/[email protected]
23+
with:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
pass_on_octokit_error: false
26+
configuration_path: .github/pr-title-checker-config.json

0 commit comments

Comments
 (0)