@@ -52,7 +52,7 @@ async function run() {
52
52
53
53
if ( eventName === "pull_request" ) {
54
54
// Print pull request title
55
- core . info ( `Pull request title: ${ pullRequest . title } ` )
55
+ core . info ( `Pull request title: ${ pullRequest . title } ` )
56
56
57
57
// Check pull request title
58
58
if ( ! regexPullRequestTitle . test ( pullRequest . title ) )
@@ -117,6 +117,7 @@ async function run() {
117
117
let commitPromises = [ ]
118
118
119
119
payload . commits . forEach ( commit => {
120
+
120
121
commitPromises . push ( octokit . rest . repos . getCommit ( {
121
122
owner : owner ,
122
123
repo : repo ,
@@ -129,9 +130,13 @@ async function run() {
129
130
commits . push ( commit )
130
131
}
131
132
}
132
-
133
+
133
134
// Check all commits
134
135
commits . forEach ( commit => {
136
+ if ( commit . parents && commit . parents . length > 1 ) {
137
+ core . info ( `Merge commit detected: ${ commit . sha } ` ) ;
138
+ return ;
139
+ }
135
140
// Split commit message
136
141
let matches = regexCommitMessageSplit . exec ( commit . commit . message )
137
142
let commitMessageSubject = matches [ 1 ]
@@ -168,7 +173,7 @@ async function run() {
168
173
169
174
if ( ! regexCommitCommitterName . test ( commit . commit . committer . name ) )
170
175
core . setFailed ( `Commit committer name does not match regex (${ commit . sha . substr ( 0 , 7 ) } )` )
171
-
176
+
172
177
// Check for valid signature
173
178
if ( prohibitUnsignedCommits && ! commit . commit . verification . verified )
174
179
core . setFailed ( `Commit has no valid signature (${ commit . sha . substr ( 0 , 7 ) } )` )
@@ -191,7 +196,7 @@ async function run() {
191
196
core . setFailed ( `Blank lines are not allowed in commit message body; line ${ ( index + 1 ) . toString ( ) } (${ commit . sha . substr ( 0 , 7 ) } )` )
192
197
} else if ( commitMessageBodyMinLength != - 1 && line . length < commitMessageBodyMinLength ) {
193
198
core . setFailed ( `Commit message body line ${ ( index + 1 ) . toString ( ) } is too short (${ commit . sha . substr ( 0 , 7 ) } )` )
194
- }
199
+ }
195
200
196
201
if ( commitMessageBodyMaxLength != - 1 && line . length > commitMessageBodyMaxLength )
197
202
core . setFailed ( `Commit message body line ${ ( index + 1 ) . toString ( ) } is too long (${ commit . sha . substr ( 0 , 7 ) } )` )
0 commit comments