ci: add pr workflow to check pr title format (#372)

* ci: add pr workflow to check pr title format

Signed-off-by: Asra Ali <asraa@google.com>
This commit is contained in:
asraa
2022-11-30 15:35:33 -06:00
committed by GitHub
parent 7bebbb9e1f
commit 128324f488
2 changed files with 28 additions and 0 deletions

14
.github/pr-title-checker-config.json vendored Normal file
View File

@@ -0,0 +1,14 @@
{
"LABEL": {
"name": "title needs adjustment",
"color": "EEEEEE"
},
"CHECKS": {
"regexp": "^(fix|feat|break|docs|chore|refactor|style|build|ci|revert|test)!?(\\(.*\\))?!?:.*"
},
"MESSAGES": {
"success": "PR title is valid",
"failure": "PR title is invalid",
"notice": "Title needs to pass regex '^(fix|feat|break|docs|chore|refactor|style|build|ci|revert|test)!?(\\(.*\\))?!?:.*"
}
}

14
.github/workflows/pr-title.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: PR Title
on:
pull_request:
types: [opened, edited, reopened, synchronize]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@e914bff8ab5e6f1a6a270da6954cd6bfd1d7f1fb # v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
configuration_path: ".github/pr-title-checker-config.json"