From d00d3190d6ae913d32bbb2d8133da5558a5cbe07 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 20 Jun 2025 21:03:45 +0200 Subject: [PATCH] workflows/labels: fix on older PRs When we made the switch from eval.yml to pr.yml we adjusted the labels job as well - but didn't take into account that we also need to deal with old PRs at the same time. Here, we fallback to another API request to get a run for eval.yml when we can't find one for pr.yml. --- .github/workflows/labels.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index f5a07fd1457e..36877d581c79 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -152,7 +152,17 @@ jobs: status: prEventCondition ? 'in_progress' : 'success', exclude_pull_requests: true, head_sha: pull_request.head.sha - })).data.workflow_runs[0]?.id + })).data.workflow_runs[0]?.id ?? + // TODO: Remove this after 2025-09-17, at which point all eval.yml artifacts will have expired. + (await github.rest.actions.listWorkflowRuns({ + ...context.repo, + // In older PRs, we need eval.yml instead of pr.yml. + workflow_id: 'eval.yml', + event: 'pull_request_target', + status: 'success', + exclude_pull_requests: true, + head_sha: pull_request.head.sha + })).data.workflow_runs[0]?.id // Newer PRs might not have run Eval to completion, yet. We can skip them, because this // job will be run as part of that Eval run anyway.