Skip to content

Commit

Permalink
feat: wait for "waiting" runs as well as "in_progress" and "queued" (#63
Browse files Browse the repository at this point in the history
)

* Wait for "waiting" runs as well as in_progress and queued

* run code style fix

Signed-off-by: Rui Chen <[email protected]>

---------

Signed-off-by: Rui Chen <[email protected]>
Co-authored-by: Rui Chen <[email protected]>
  • Loading branch information
zachwhaley and chenrui333 authored Jul 17, 2024
1 parent 66cb6b2 commit 35d47b4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export class OctokitGitHub {
...options,
status: "queued" as const,
};
const waiting_options = {
...options,
status: "waiting" as const,
};

const in_progress_runs = this.octokit.paginate(
this.octokit.actions.listWorkflowRuns,
Expand All @@ -73,8 +77,13 @@ export class OctokitGitHub {
queued_options,
);

return Promise.all([in_progress_runs, queued_runs]).then((values) =>
values.flat(),
const waiting_runs = this.octokit.paginate(
this.octokit.actions.listWorkflowRuns,
waiting_options,
);

return Promise.all([in_progress_runs, queued_runs, waiting_runs]).then(
(values) => values.flat(),
);
};
}

0 comments on commit 35d47b4

Please sign in to comment.