Skip to content

Commit 128324f

Browse files
authored
ci: add pr workflow to check pr title format (#372)
* ci: add pr workflow to check pr title format Signed-off-by: Asra Ali <[email protected]>
1 parent 7bebbb9 commit 128324f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

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

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"LABEL": {
3+
"name": "title needs adjustment",
4+
"color": "EEEEEE"
5+
},
6+
"CHECKS": {
7+
"regexp": "^(fix|feat|break|docs|chore|refactor|style|build|ci|revert|test)!?(\\(.*\\))?!?:.*"
8+
},
9+
"MESSAGES": {
10+
"success": "PR title is valid",
11+
"failure": "PR title is invalid",
12+
"notice": "Title needs to pass regex '^(fix|feat|break|docs|chore|refactor|style|build|ci|revert|test)!?(\\(.*\\))?!?:.*"
13+
}
14+
}

.github/workflows/pr-title.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: PR Title
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
jobs:
8+
validate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: thehanimo/pr-title-checker@e914bff8ab5e6f1a6a270da6954cd6bfd1d7f1fb # v1
12+
with:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
configuration_path: ".github/pr-title-checker-config.json"

0 commit comments

Comments
 (0)