-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (30 loc) · 1.06 KB
/
lint-PR-title.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Lint Pull Request Title
on:
pull_request:
types:
- opened
- edited
- reopened
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.event.pull_request.title }}
regex: '(?:build|chore|ci|docs|feat|fix|perf|refactor|revert|style|add|update|task|chore|test)\([a-z-A-Z-0-9]+\):\s.+'
- uses: actions-ecosystem/action-create-comment@v1
if: ${{ steps.regex-match.outputs.match == '' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body: |
:warning: The title of this PR is invalid.
Please make the title match this format `<type>(<scope>): <description>`.
e.g.)
`add(cli): enable --verbose flag`
`fix(api): avoid unexpected error in handler`
allowed types - add, update, task, chore, feat, test, fix
- run: exit 1
if: ${{ steps.regex-match.outputs.match == '' }}