Skip to content

Commit

Permalink
main: just use original solution
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Mar 22, 2020
1 parent 2911d93 commit c38e743
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,20 @@ async function main() {
console.log("==> Commit:", commit)

// https://github.com/octokit/routes/issues/665
const runs = await client.actions.listWorkflowRunsFixed.endpoint.merge({
const options = await client.actions.listWorkflowRunsFixed.endpoint.merge({
owner: owner,
repo: repo,
workflow_id: workflow,
})

const run = async () => {
for await (const response of client.paginate.iterator(runs)) {
const run = response.data.workflow_runs.find((run) => {
return run.head_sha == commit
})
if (run)
return run
let run
for await (const response of client.paginate.iterator(options)) {
const matching_run = response.data.workflow_runs.find((workflow_run) => {
return workflow_run.head_sha == commit
})
if (matching_run) {
run = matching_run
break
}
}

Expand Down

0 comments on commit c38e743

Please sign in to comment.