github.ts

view source

Declarations
#

7 declarations

fetch_github_check_runs
#

github.ts view source

(repo_info: GithubRepoInfo, options?: { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; ... 4 more ...; fetch?: { ...; } | undefined; }): Promise<...> import {fetch_github_check_runs} from '@fuzdev/fuz_repos/github.js';

Fetches the check runs on ref and reduces them to one overall status and conclusion.

repo_info

the repo's GitHub owner and name

options

the cache, logger, token, API version, ref (main by default), and fetch

type { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; log?: Logger | undefined; token?: string | undefined; api_version?: string | undefined; ref?: string | undefined; fetch?: { ...; } | undefined; }
default {}

returns

Promise<Result>

the reduced check runs, null for a ref with none (a repo without CI, or a commit CI skipped), or a failure when the request or its parse failed

throws

  • Error - on a 401 response (check `SECRET_GITHUB_API_TOKEN`) or a repo without an owner

see also

fetch_github_pull_requests
#

github.ts view source

(repo_info: GithubRepoInfo, options?: { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; log?: Logger | undefined; token?: string | undefined; api_version?: string | undefined; fetch?: { ...; } | undefined; }): Promise<...> import {fetch_github_pull_requests} from '@fuzdev/fuz_repos/github.js';

repo_info

options

type { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; log?: Logger | undefined; token?: string | undefined; api_version?: string | undefined; fetch?: { ...; } | undefined; }
default {}

returns

Promise<GithubPullRequest[] | null>

see also

GithubCheckRuns
#

github.ts view source

value + type

{ total_count: number; check_runs: { status: "queued" | "in_progress" | "completed"; conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null; }[]; } import {GithubCheckRuns} from '@fuzdev/fuz_repos/github.js';

total_count

type number

check_runs

type GithubCheckRunsItem[]

GithubCheckRunsItem
#

github.ts view source

value + type

{ status: "queued" | "in_progress" | "completed"; conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null; } import {GithubCheckRunsItem} from '@fuzdev/fuz_repos/github.js';

see also

status

type "queued" | "in_progress" | "completed"

conclusion

type "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null

GithubPullRequest
#

GithubPullRequests
#

github.ts view source

value + type

{ number: number; title: string; user: { login: string; }; draft: boolean; }[]

type GithubPullRequest[]

import {GithubPullRequests} from '@fuzdev/fuz_repos/github.js';

GithubRepoInfo
#

github.ts view source

GithubRepoInfo import type {GithubRepoInfo} from '@fuzdev/fuz_repos/github.js';

Minimal interface for GitHub API calls, satisfied structurally by fuz_ui's Library.

owner_name

type string | null

repo_name

type string

Imported by
#