@@ -339,6 +339,15 @@ const handlePush = async (context, req) => {
339
339
`The 'tag-git' run at ${ latest . html_url } did not succeed (conclusion = ${ latest . conclusion } ).`
340
340
)
341
341
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
+
342
351
// There is already a `tag-git` workflow run; Is there already an `upload-snapshot` run?
343
352
const latestUploadSnapshotRun = ( await listCheckRunsForCommit (
344
353
context ,
@@ -354,20 +363,15 @@ const handlePush = async (context, req) => {
354
363
const tagGitCheckRunTitle = `Upload snapshot Git @${ commit } `
355
364
const tagGitCheckRunId = await queueCheckRun (
356
365
context ,
357
- await getToken ( ) ,
366
+ await getToken ( context , pushOwner , pushRepo ) ,
358
367
pushOwner ,
359
368
pushRepo ,
360
369
commit ,
361
- 'tag-git ' ,
370
+ 'upload-snapshot ' ,
362
371
tagGitCheckRunTitle ,
363
372
tagGitCheckRunTitle
364
373
)
365
374
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
-
371
375
try {
372
376
const workFlowRunIDs = { }
373
377
for ( const architecture of [ 'x86_64' , 'i686' , 'aarch64' ] ) {
@@ -381,7 +385,7 @@ const handlePush = async (context, req) => {
381
385
workflowName
382
386
)
383
387
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 } )`
385
389
const latest2 = runs
386
390
. filter ( run => run . output . summary === needle )
387
391
. sort ( ( a , b ) => a . id - b . id )
@@ -409,7 +413,7 @@ const handlePush = async (context, req) => {
409
413
const answer = await triggerWorkflowDispatch (
410
414
context ,
411
415
gitForWindowsAutomationToken ,
412
- pushRepo ,
416
+ pushOwner ,
413
417
'git-for-windows-automation' ,
414
418
'upload-snapshot.yml' ,
415
419
'main' , {
0 commit comments