-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (49 loc) · 1.66 KB
/
test.yml
File metadata and controls
52 lines (49 loc) · 1.66 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: 'Commit Message Check'
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
push:
branches:
- main
- 'releases/*'
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Check Commit Type
uses: gsactions/commit-message-checker@v1
with:
#pattern: '\[[^]]+\] .+$'
pattern: '(Feat|feat|Fix|fix|Design|design|Style|style|Refactor|refactor|Comment|comment|Docs|docs|Test|test|Chore|chore|Rename|rename|Remove|remove) .+$'
flags: 'gm'
error: 'need Your first line has to contain a commit type like "[BUGFIX]".'
run-if-fail:
if: ${{ always() && (needs.check-commit-message.result=='failure') }}
needs: [check-commit-message]
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: ${{ env.PR_NUMBER }},
owner: context.repo.owner,
repo: context.repo.repo,
body: '요청해 주신 PR이 [하모나이즈 프로젝트의 커밋 컨벤션](https://github.com/hamonikr/hamonize/blob/master/.gitmessage.txt)을 위반합니다. \n
커밋 메시지와 PR title에 다음 Commit Type 중 하나를 포함해 주세요. \n
Feat Fix Design Style Refactor Comment Docs Test Chore Rename Remove'
})