File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -166,15 +166,15 @@ const cascadingRuns = async (context, req) => {
166
166
167
167
// Next, check that the commit is on the `main` branch
168
168
const gitToken = await getToken ( context , checkRunOwner , checkRunRepo )
169
- const { ahead_by } = await githubApiRequest (
169
+ const { ahead_by, behind_by } = await githubApiRequest (
170
170
context ,
171
171
gitToken ,
172
172
'GET' ,
173
173
`/repos/${ checkRunOwner } /${ checkRunRepo } /compare/HEAD...${ commit } ` ,
174
174
// `/repos/dscho/git/compare/HEAD...${commit}`,
175
175
)
176
176
if ( ahead_by > 0 ) {
177
- return `Ignoring ${ name } check-run because its corresponding commit ${ commit } is not on the main branch`
177
+ return `Ignoring ${ name } check-run because its corresponding commit ${ commit } is not on the main branch (ahead by ${ ahead_by } , behind by ${ behind_by } ) `
178
178
}
179
179
180
180
const workFlowRunIDs = { }
@@ -246,7 +246,7 @@ const cascadingRuns = async (context, req) => {
246
246
}
247
247
)
248
248
249
- return `The 'upload-snapshot' workflow run was started at ${ answer . html_url } `
249
+ return `The 'upload-snapshot' workflow run was started at ${ answer . html_url } (ahead by ${ ahead_by } , behind by ${ behind_by } ) `
250
250
}
251
251
return `Not a cascading run: ${ name } ; Doing nothing.`
252
252
}
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ The \`git-artifacts-aarch64\` workflow run [was started](dispatched-workflow-git
175
175
}
176
176
if ( method === 'GET' && requestPath ===
177
177
'/repos/git-for-windows/git/compare/HEAD...0c796d3013a57e8cc894c152f0200107226e5dd1' ) {
178
- return { ahead_by : 0 }
178
+ return { ahead_by : 0 , behind_by : 99 }
179
179
}
180
180
throw new Error ( `Unhandled ${ method } -${ requestPath } -${ JSON . stringify ( payload ) } ` )
181
181
} )
@@ -994,7 +994,7 @@ test('the third completed `git-artifacts-<arch>` check-run triggers an `upload-s
994
994
try {
995
995
expect ( await index ( context , context . req ) ) . toBeUndefined ( )
996
996
expect ( context . res ) . toEqual ( {
997
- body : `The 'upload-snapshot' workflow run was started at dispatched-workflow-upload-snapshot.yml` ,
997
+ body : `The 'upload-snapshot' workflow run was started at dispatched-workflow-upload-snapshot.yml (ahead by 0, behind by 99) ` ,
998
998
headers : undefined ,
999
999
status : undefined
1000
1000
} )
You can’t perform that action at this time.
0 commit comments