workflows/reviewers: fix downloading eval results when undrafting

To actually download the eval results and then proceed to ping
maintainers after undrafting, the run-id must be specified explicitly.

Because we didn't run with `-o pipefail` up to the last commit, we
didn't notice that this workflow was silently failing with this error:

  jq: error: Could not open file comparison/maintainers.json: No such
file or directory
This commit is contained in:
Wolfgang Walther
2025-06-10 22:00:43 +02:00
parent 0f5e504f9e
commit 530f896efa
+5
View File
@@ -62,6 +62,7 @@ jobs:
# In the more special case, when a PR is undrafted an eval run will have started already.
- name: Wait for comparison to be done
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: eval
with:
script: |
const run_id = (await github.rest.actions.listWorkflowRuns({
@@ -72,6 +73,8 @@ jobs:
head_sha: context.payload.pull_request.head.sha
})).data.workflow_runs[0].id
core.setOutput('run-id', run_id)
// Waiting 120 * 5 sec = 10 min. max.
// The extreme case is an Eval run that just started when the PR is undrafted.
// Eval takes max 5-6 minutes, normally.
@@ -90,6 +93,8 @@ jobs:
- name: Download the comparison results
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
run-id: ${{ steps.eval.outputs.run-id }}
github-token: ${{ github.token }}
pattern: comparison
path: comparison
merge-multiple: true