Skip to content

Commit 3cb846a

Browse files
jcfrjamesobutlerpieper
committed
ENH: Add "Commit Message Check" composite action
Co-authored-by: James Butler <james.butler@perkinelmer.com> Co-authored-by: Steve Pieper <pieper@isomics.com>
1 parent 931e158 commit 3cb846a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

action.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Commit Message Check"
2+
description: "Check Commit Messages match Slicer style"
3+
inputs:
4+
token:
5+
description:
6+
"GitHub access token used to list and check all pull request commits"
7+
required: true
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Check Commit Prefix
12+
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee # v2.0.0
13+
with:
14+
pattern: "^(ENH|PERF|BUG|STYLE|DOC|COMP): ([A-Z])+"
15+
flags: "gm"
16+
excludeDescription: "true" # optional: this excludes the description body of a pull request
17+
excludeTitle: "true" # optional: this excludes the title of a pull request
18+
error:
19+
'The first line has to start with a commit prefix, followed by a colon
20+
and space, and then followed by a message with a capital letter (e.g
21+
"ENH: Add support for awesome feature"). For more details on other
22+
requirements, see
23+
https://slicer.readthedocs.io/en/latest/developer_guide/style_guide.html#commits'
24+
checkAllCommitMessages: "true" # optional: this checks all commits associated with a pull request
25+
accessToken: ${{ inputs.token }} # github access token is only required if checkAllCommitMessages is true
26+
27+
- name: Check Line Length
28+
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee # v2.0.0
29+
with:
30+
pattern: "^[^#].{1,78}$"
31+
error:
32+
"The maximum line length of 78 characters is exceeded. For more
33+
details, see
34+
https://slicer.readthedocs.io/en/latest/developer_guide/style_guide.html#commits"
35+
excludeDescription: "true" # optional: this excludes the description body of a pull request
36+
excludeTitle: "true" # optional: this excludes the title of a pull request
37+
checkAllCommitMessages: "true" # optional: this checks all commits associated with a pull request
38+
accessToken: ${{ inputs.token }} # github access token is only required if checkAllCommitMessages is true

0 commit comments

Comments
 (0)