@@ -339,6 +339,15 @@ const handlePush = async (context, req) => {
339339 `The 'tag-git' run at ${ latest . html_url } did not succeed (conclusion = ${ latest . conclusion } ).`
340340 )
341341
342+ const match = latest . output . summary . match ( / ^ T a g G i t ( \S + ) @ ( [ 0 - 9 a - f ] + ) $ / )
343+ if ( ! match ) throw new Error ( `Unexpected summary '${ latest . output . summary } ' of tag-git run: ${ latest . html_url } ` )
344+ if ( ! match [ 2 ] === commit ) throw new Error ( `Unexpected revision ${ match [ 2 ] } '${ latest . output . summary } ' of tag-git run: ${ latest . html_url } ` )
345+ const ver = match [ 1 ]
346+
347+ const match2 = latest . output . text . match ( / ^ F o r d e t a i l s , s e e \[ t h i s r u n \] \( h t t p s : \/ \/ g i t h u b .c o m \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ a c t i o n s \/ r u n s \/ ( \d + ) \) / )
348+ if ( ! match2 ) throw new Error ( `Unexpected summary '${ latest . output . summary } ' of tag-git run: ${ latest . html_url } ` )
349+ const [ , , , tagGitWorkflowRunId ] = match2
350+
342351 // There is already a `tag-git` workflow run; Is there already an `upload-snapshot` run?
343352 const latestUploadSnapshotRun = ( await listCheckRunsForCommit (
344353 context ,
@@ -354,20 +363,15 @@ const handlePush = async (context, req) => {
354363 const tagGitCheckRunTitle = `Upload snapshot Git @${ commit } `
355364 const tagGitCheckRunId = await queueCheckRun (
356365 context ,
357- await getToken ( ) ,
366+ await getToken ( context , pushOwner , pushRepo ) ,
358367 pushOwner ,
359368 pushRepo ,
360369 commit ,
361- 'tag-git ' ,
370+ 'upload-snapshot ' ,
362371 tagGitCheckRunTitle ,
363372 tagGitCheckRunTitle
364373 )
365374
366- const match = latest . output . summary . match ( / ^ T a g G i t ( \S + ) @ ( [ 0 - 9 a - f ] + ) $ / )
367- if ( ! match ) throw new Error ( `Unexpected summary '${ latest . output . summary } ' of tag-git run: ${ latest . html_url } ` )
368- if ( ! match [ 2 ] === commit ) throw new Error ( `Unexpected revision ${ match [ 2 ] } '${ latest . output . summary } ' of tag-git run: ${ latest . html_url } ` )
369- const ver = match [ 1 ]
370-
371375 try {
372376 const workFlowRunIDs = { }
373377 for ( const architecture of [ 'x86_64' , 'i686' , 'aarch64' ] ) {
@@ -381,7 +385,7 @@ const handlePush = async (context, req) => {
381385 workflowName
382386 )
383387 const needle =
384- `Build Git ${ ver } artifacts from commit ${ commit } (tag-git run #${ latest . id } )`
388+ `Build Git ${ ver } artifacts from commit ${ commit } (tag-git run #${ tagGitWorkflowRunId } )`
385389 const latest2 = runs
386390 . filter ( run => run . output . summary === needle )
387391 . sort ( ( a , b ) => a . id - b . id )
@@ -409,7 +413,7 @@ const handlePush = async (context, req) => {
409413 const answer = await triggerWorkflowDispatch (
410414 context ,
411415 gitForWindowsAutomationToken ,
412- pushRepo ,
416+ pushOwner ,
413417 'git-for-windows-automation' ,
414418 'upload-snapshot.yml' ,
415419 'main' , {
0 commit comments