@@ -67,23 +67,27 @@ jobs:
6767 }
6868 console.log('Found PR Update workflow ID:', prUpdateWorkflow.id);
6969
70- // Find the most recent run for this SHA with blob-report artifacts
70+ // Find the most recent completed run for this branch with blob-report artifacts
71+ // We search by branch instead of SHA to handle cases where:
72+ // 1. The PR was updated after E2E tests ran (artifacts exist for older SHA)
73+ // 2. The current run for the SHA is still queued/in-progress
7174 const { data: runs } = await github.rest.actions.listWorkflowRuns({
7275 owner: context.repo.owner,
7376 repo: context.repo.repo,
7477 workflow_id: prUpdateWorkflow.id,
75- head_sha: headSha,
76- per_page: 10
78+ branch: headBranch,
79+ status: 'completed',
80+ per_page: 20
7781 });
7882
79- console.log('Found', runs.workflow_runs.length, 'runs for SHA' );
83+ console.log('Found', runs.workflow_runs.length, 'completed runs for branch', headBranch );
8084
8185 // Find a run with blob-report artifacts
8286 let selectedRun = null;
8387 let hasBlobReports = false;
8488
8589 for (const run of runs.workflow_runs) {
86- console.log('Checking run', run.id, 'status:', run.status, ' conclusion:', run.conclusion);
90+ console.log('Checking run', run.id, 'conclusion:', run.conclusion);
8791
8892 const { data: artifacts } = await github.rest.actions.listWorkflowRunArtifacts({
8993 owner: context.repo.owner,
0 commit comments