@@ -229,14 +229,14 @@ async function run() {
229
229
let current ;
230
230
231
231
try {
232
- core . info ( 'Downloading base results...' ) ;
232
+ core . warning ( 'Downloading base results...' ) ;
233
233
const artifacts = await getArtifactsForBranchAndWorkflow ( octokit , {
234
234
...repo ,
235
235
artifactName : ARTIFACT_NAME ,
236
236
branch : comparisonBranch ,
237
237
workflowName : `${ process . env . GITHUB_WORKFLOW || '' } ` ,
238
238
} ) ;
239
- core . info ( 'Fetched artifacts for base results' ) ;
239
+ core . warning ( 'Fetched artifacts for base results' ) ;
240
240
241
241
if ( ! artifacts ) {
242
242
throw new Error ( 'No artifacts found' ) ;
@@ -249,7 +249,7 @@ async function run() {
249
249
downloadPath : __dirname ,
250
250
} ) ;
251
251
252
- core . info ( 'Downloaded base results' ) ;
252
+ core . warning ( 'Downloaded base results' ) ;
253
253
base = JSON . parse ( await fs . readFile ( resultsFilePath , { encoding : 'utf8' } ) ) ;
254
254
} catch ( error ) {
255
255
core . startGroup ( 'Warning, unable to find base results' ) ;
@@ -352,7 +352,7 @@ export async function getArtifactsForBranchAndWorkflow(octokit, { owner, repo, w
352
352
}
353
353
354
354
if ( ! repositoryWorkflow ) {
355
- core . info (
355
+ core . warning (
356
356
`Unable to find workflow with name "${ workflowName } " in the repository. Found workflows: ${ allWorkflows . join (
357
357
', ' ,
358
358
) } `,
@@ -362,19 +362,20 @@ export async function getArtifactsForBranchAndWorkflow(octokit, { owner, repo, w
362
362
}
363
363
364
364
const workflow_id = repositoryWorkflow . id ;
365
- core . info ( repositoryWorkflow ) ;
365
+ core . warning ( repositoryWorkflow ) ;
366
366
367
367
let currentPage = 0 ;
368
368
const completedWorkflowRuns = [ ] ;
369
369
370
- core . info ( 'Get runs for:' ) ;
370
+ core . warning ( 'Get runs for:' ) ;
371
371
console . log ( {
372
372
workflow_id,
373
373
branch,
374
374
status : 'success' ,
375
375
per_page : DEFAULT_PAGE_LIMIT ,
376
376
event : 'push' ,
377
377
} ) ;
378
+ console . log ( 'compare with' , `${ owner } /${ repo } ` )
378
379
379
380
for await ( const response of octokit . paginate . iterator ( octokit . rest . actions . listWorkflowRuns , {
380
381
owner,
@@ -385,7 +386,6 @@ export async function getArtifactsForBranchAndWorkflow(octokit, { owner, repo, w
385
386
per_page : DEFAULT_PAGE_LIMIT ,
386
387
event : 'push' ,
387
388
} ) ) {
388
- console . log ( 'response' , response . data . length ) ;
389
389
if ( ! response . data . length ) {
390
390
core . warning ( `Workflow ${ workflow_id } not found in branch ${ branch } ` ) ;
391
391
core . endGroup ( ) ;
@@ -397,8 +397,8 @@ export async function getArtifactsForBranchAndWorkflow(octokit, { owner, repo, w
397
397
...response . data . filter ( workflowRun => workflowRun . head_repository . full_name === `${ owner } /${ repo } ` ) ,
398
398
) ;
399
399
400
- if ( ! completedWorkflowRuns . length ) {
401
- continue ;
400
+ if ( completedWorkflowRuns . length ) {
401
+ break ;
402
402
}
403
403
404
404
if ( currentPage > DEFAULT_MAX_PAGES ) {
@@ -410,9 +410,11 @@ export async function getArtifactsForBranchAndWorkflow(octokit, { owner, repo, w
410
410
currentPage ++ ;
411
411
}
412
412
413
+ console . log ( 'completed workflows' , completedWorkflowRuns . length ) ;
414
+
413
415
// Search through workflow artifacts until we find a workflow run w/ artifact name that we are looking for
414
416
for ( const workflowRun of completedWorkflowRuns ) {
415
- core . info ( `Checking artifacts for workflow run: ${ workflowRun . html_url } ` ) ;
417
+ core . warning ( `Checking artifacts for workflow run: ${ workflowRun . html_url } ` ) ;
416
418
417
419
const {
418
420
data : { artifacts } ,
@@ -423,13 +425,13 @@ export async function getArtifactsForBranchAndWorkflow(octokit, { owner, repo, w
423
425
} ) ;
424
426
425
427
if ( ! artifacts ) {
426
- core . info (
428
+ core . warning (
427
429
`Unable to fetch artifacts for branch: ${ branch } , workflow: ${ workflow_id } , workflowRunId: ${ workflowRun . id } ` ,
428
430
) ;
429
431
} else {
430
432
const foundArtifact = artifacts . find ( ( { name } ) => name === artifactName ) ;
431
433
if ( foundArtifact ) {
432
- core . info ( `Found suitable artifact: ${ foundArtifact . url } ` ) ;
434
+ core . warning ( `Found suitable artifact: ${ foundArtifact . url } ` ) ;
433
435
return {
434
436
artifact : foundArtifact ,
435
437
workflowRun,
0 commit comments