Skip to content

Commit

Permalink
fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chenrui333 committed Jun 19, 2024
1 parent c5e3229 commit 1086c65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class OctokitGitHub {
throttle: {
onRateLimit: (retryAfter, options) => {
warning(
`Request quota exhausted for request ${options.method} ${options.url}`,
`Request quota exhausted for request ${options.method} ${options.url}`
);

if (options.request.retryCount === 0) {
Expand Down Expand Up @@ -39,14 +39,13 @@ export class OctokitGitHub {
owner: string,
repo: string,
branch: string | undefined,
workflow_id: number,
workflow_id: number
) => {
const options: Endpoints["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"]["parameters"] =
{
owner,
repo,
workflow_id,
status: "in_progress",
per_page: 100,
};

Expand All @@ -56,22 +55,25 @@ export class OctokitGitHub {

const in_progress_options = {
...options,
status: "in_progress",
status: "in_progress" as const,
};
const queued_options = {
...options,
status: "queued",
status: "queued" as const,
};

const in_progress_runs = this.octokit.paginate(
this.octokit.actions.listWorkflowRuns.endpoint.merge(in_progress_options),
this.octokit.actions.listWorkflowRuns,
in_progress_options
);

const queued_runs = this.octokit.paginate(
this.octokit.actions.listWorkflowRuns.endpoint.merge(queued_options),
this.octokit.actions.listWorkflowRuns,
queued_options
);

return Promise.all([in_progress_runs, queued_runs]).then((runs) =>
[].concat.apply<never[], any, Array<Run>>([], runs),
return Promise.all([in_progress_runs, queued_runs]).then((values) =>
values.flat()
);
};
}

0 comments on commit 1086c65

Please sign in to comment.