@@ -134,38 +134,45 @@ tap.test('should skip non-dependabot PR', async () => {
134
134
sinon . assert . notCalled ( stubs . mergeStub )
135
135
} )
136
136
137
- tap . test ( 'should skip PR with non dependabot commit' , async ( ) => {
138
- const PR_NUMBER = Math . random ( )
139
- const { action, stubs } = buildStubbedAction ( {
140
- payload : {
141
- pull_request : {
142
- user : {
143
- login : BOT_NAME ,
137
+ const prCommitsStubs = [
138
+ {
139
+ author : {
140
+ login : 'not dependabot' ,
141
+ } ,
142
+ } ,
143
+ {
144
+ author : undefined ,
145
+ } ,
146
+ ]
147
+
148
+ for ( const prCommitsStub of prCommitsStubs ) {
149
+ tap . test ( 'should skip PR with non dependabot commit' , async ( ) => {
150
+ const PR_NUMBER = Math . random ( )
151
+ const { action, stubs } = buildStubbedAction ( {
152
+ payload : {
153
+ pull_request : {
154
+ user : {
155
+ login : BOT_NAME ,
156
+ } ,
157
+ number : PR_NUMBER ,
144
158
} ,
145
- number : PR_NUMBER ,
146
159
} ,
147
- } ,
148
- inputs : { PR_NUMBER } ,
149
- } )
160
+ inputs : { PR_NUMBER } ,
161
+ } )
150
162
151
- stubs . prCommitsStub . resolves ( [
152
- {
153
- author : {
154
- login : 'not dependabot' ,
155
- } ,
156
- } ,
157
- ] )
163
+ stubs . prCommitsStub . resolves ( [ prCommitsStub ] )
158
164
159
- await action ( )
165
+ await action ( )
160
166
161
- sinon . assert . calledOnce ( stubs . prCommitsStub )
162
- sinon . assert . calledWithExactly (
163
- stubs . logStub . logWarning ,
164
- 'PR contains non dependabot commits, skipping.'
165
- )
166
- sinon . assert . notCalled ( stubs . approveStub )
167
- sinon . assert . notCalled ( stubs . mergeStub )
168
- } )
167
+ sinon . assert . calledOnce ( stubs . prCommitsStub )
168
+ sinon . assert . calledWithExactly (
169
+ stubs . logStub . logWarning ,
170
+ 'PR contains non dependabot commits, skipping.'
171
+ )
172
+ sinon . assert . notCalled ( stubs . approveStub )
173
+ sinon . assert . notCalled ( stubs . mergeStub )
174
+ } )
175
+ }
169
176
170
177
tap . test (
171
178
'should skip PR if dependabot commit signatures cannot be verified' ,
0 commit comments