Unverified Commit d00d3190 authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

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.
parent 155ea15a
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -152,6 +152,16 @@ jobs:
                    status: prEventCondition ? 'in_progress' : 'success',
                    exclude_pull_requests: true,
                    head_sha: pull_request.head.sha
                  })).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