mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
mypy_primer: check conclusion field as well (#5272)
Fixes #5270 The comment workflow waits for the mypy primer to run. I think with Github's changes to workflow running, these runs get marked as completed, but have the conclusion "action_required". E.g., see https://github.com/python/typeshed/pull/5269/checks
This commit is contained in:
7
.github/workflows/mypy_primer_comment.yml
vendored
7
.github/workflows/mypy_primer_comment.yml
vendored
@@ -47,14 +47,17 @@ jobs:
|
||||
workflow_id: "mypy_primer.yml",
|
||||
})
|
||||
if (response) {
|
||||
return response.data.workflow_runs.find(run => run.head_sha == pr_commit_sha)
|
||||
workflow_runs = response.data.workflow_runs
|
||||
// Sort by reverse updated_at
|
||||
workflow_runs.sort((a, b) => new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime())
|
||||
return workflow_runs.find(run => run.head_sha == pr_commit_sha)
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
const end_time = Number(new Date()) + 60 * 60 * 1000
|
||||
let primer_run = await check_mypy_primer()
|
||||
while (!primer_run || primer_run.status != "completed") {
|
||||
while (!primer_run || primer_run.status != "completed" || primer_run.conclusion != "success") {
|
||||
if (Number(new Date()) > end_time) {
|
||||
throw Error("Timed out waiting for mypy_primer")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user