Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/client/github_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import type { ArgumentOptions } from "../arg_options.js";

const DEBUG_PER_PAGE = 10;

type ThrottleRequestOptions = { method: string; url: string };

export type WorkflowItem =
RestEndpointMethodTypes["actions"]["listRepoWorkflows"]["response"]["data"]["workflows"][0];
type WorkflowRunsItem =
Expand All @@ -33,7 +35,7 @@ export class GithubClient {
baseUrl: baseUrl ? baseUrl : "https://api.github.com",
log: options.debug ? console : undefined,
throttle: {
onRateLimit: (retryAfter, options, _octokit, retryCount) => {
onRateLimit: (retryAfter: number, options: ThrottleRequestOptions, _octokit: unknown, retryCount: number) => {
this.#octokit.log.warn(
`Request quota exhausted for request ${options.method} ${options.url}`,
);
Expand All @@ -43,7 +45,7 @@ export class GithubClient {
return true;
}
},
onSecondaryRateLimit: (_retryAfter, options, _octokit, _retryCount) => {
onSecondaryRateLimit: (_retryAfter: number, options: ThrottleRequestOptions, _octokit: unknown, _retryCount: number) => {
// does not retry, only logs a warning
this.#octokit.log.warn(
`Abuse detected for request ${options.method} ${options.url}`,
Expand Down