Skip to content

Commit 1c5f056

Browse files
fix: search by branch instead of SHA in E2E report workflow_dispatch (#26168)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent fe4017f commit 1c5f056

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/e2e-report.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)