Skip to content

GitHubIssues

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:78

The GitHub implementation of the issues capability, backed by GitHub Issues and status labels.

  • Issues

new GitHubIssues(client, opts): GitHubIssues

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:91

{ listBranches: (repo) => Promise<GitHubBranch[]>; protectBranch: (repo, branch, payload) => Promise<void>; removeBranch: (repo, branch) => Promise<void>; }

(repo) => Promise<GitHubBranch[]>

(repo, branch, payload) => Promise<void>

(repo, branch) => Promise<void>

{ createCheckRun: (repo, input) => Promise<GitHubCheckRun>; listCheckRunsForRef: (repo, ref) => Promise<GitHubCheckRun[]>; updateCheckRun: (repo, checkRunId, input) => Promise<GitHubCheckRun>; }

(repo, input) => Promise<GitHubCheckRun>

(repo, ref) => Promise<GitHubCheckRun[]>

(repo, checkRunId, input) => Promise<GitHubCheckRun>

{ deleteEnvironment: (repo, name) => Promise<void>; listEnvironments: (repo) => Promise<GitHubEnvironment[]>; upsertEnvironment: (repo, name, body) => Promise<void>; }

(repo, name) => Promise<void>

(repo) => Promise<GitHubEnvironment[]>

(repo, name, body) => Promise<void>

{ createBlob: (repo, content, encoding?) => Promise<GitBlob>; createCommit: (repo, message, tree, parents) => Promise<GitCommit>; createPull: (repo, input) => Promise<GitPull>; createRef: (repo, ref, sha) => Promise<GitRef>; createTree: (repo, tree, baseTree?) => Promise<GitTree>; getCommit: (repo, sha) => Promise<GitCommit>; getContents: (repo, path, ref?) => Promise<GitContents>; getRef: (repo, branch) => Promise<GitRef>; getTree: (repo, sha, recursive?) => Promise<GitTree>; listDirectory: (repo, path, options?) => Promise<GitDirectoryEntry[]>; listTree: (repo, path, options?) => Promise<GitDirectoryEntry[] | undefined>; putContents: (repo, path, input) => Promise<PutContentsResult>; updateRef: (repo, ref, sha, force?) => Promise<GitRef>; }

(repo, content, encoding?) => Promise<GitBlob>

(repo, message, tree, parents) => Promise<GitCommit>

(repo, input) => Promise<GitPull>

(repo, ref, sha) => Promise<GitRef>

(repo, tree, baseTree?) => Promise<GitTree>

(repo, sha) => Promise<GitCommit>

(repo, path, ref?) => Promise<GitContents>

(repo, branch) => Promise<GitRef>

(repo, sha, recursive?) => Promise<GitTree>

(repo, path, options?) => Promise<GitDirectoryEntry[]>

(repo, path, options?) => Promise<GitDirectoryEntry[] | undefined>

(repo, path, input) => Promise<PutContentsResult>

(repo, ref, sha, force?) => Promise<GitRef>

GraphQLClient

The GraphQL client, for the callers whose API (Projects v2) has no REST form.

{ createHook: (scope, input) => Promise<GitHubHook>; listHooks: (scope) => Promise<GitHubHook[]>; updateHook: (scope, id, input) => Promise<GitHubHook>; }

(scope, input) => Promise<GitHubHook>

(scope) => Promise<GitHubHook[]>

(scope, id, input) => Promise<GitHubHook>

{ addValues: (repo, number, values) => Promise<GitHubIssueFieldValue[]>; deleteValue: (repo, number, fieldId) => Promise<void>; list: (org) => Promise<GitHubIssueField[]>; values: (repo, number) => Promise<GitHubIssueFieldValue[]>; }

(repo, number, values) => Promise<GitHubIssueFieldValue[]>

(repo, number, fieldId) => Promise<void>

(org) => Promise<GitHubIssueField[]>

(repo, number) => Promise<GitHubIssueFieldValue[]>

{ addBlockedBy: (repo, number, blockerId) => Promise<GitHubIssue>; addLabels: (repo, number, labels) => Promise<void>; addSubIssue: (repo, number, subIssueId, replaceParent?) => Promise<GitHubIssue>; countSearch: (repo, query) => Promise<number>; createComment: (repo, number, body) => Promise<void>; createIssue: (repo, body) => Promise<GitHubIssue>; createMilestone: (repo, title) => Promise<GitHubMilestone>; getIssue: (repo, number) => Promise<GitHubIssue>; getParent: (repo, number) => Promise<GitHubIssue | null>; listBlockedBy: (repo, number) => Promise<GitHubIssue[]>; listComments: (repo, number) => Promise<GitHubIssueComment[]>; listIssues: (repo, params?) => Promise<GitHubIssue[]>; listMilestones: (repo, params?) => Promise<GitHubMilestone[]>; removeBlockedBy: (repo, number, blockerId) => Promise<GitHubIssue>; removeLabel: (repo, number, label) => Promise<void>; removeSubIssue: (repo, number, subIssueId) => Promise<GitHubIssue>; updateIssue: (repo, number, body) => Promise<GitHubIssue>; }

(repo, number, blockerId) => Promise<GitHubIssue>

(repo, number, labels) => Promise<void>

(repo, number, subIssueId, replaceParent?) => Promise<GitHubIssue>

(repo, query) => Promise<number>

(repo, number, body) => Promise<void>

(repo, body) => Promise<GitHubIssue>

(repo, title) => Promise<GitHubMilestone>

(repo, number) => Promise<GitHubIssue>

(repo, number) => Promise<GitHubIssue | null>

(repo, number) => Promise<GitHubIssue[]>

(repo, number) => Promise<GitHubIssueComment[]>

(repo, params?) => Promise<GitHubIssue[]>

(repo, params?) => Promise<GitHubMilestone[]>

(repo, number, blockerId) => Promise<GitHubIssue>

(repo, number, label) => Promise<void>

(repo, number, subIssueId) => Promise<GitHubIssue>

(repo, number, body) => Promise<GitHubIssue>

{ create: (org, input) => Promise<OrgIssueTypeInfo>; list: (org) => Promise<OrgIssueTypeInfo[]>; update: (org, id, input) => Promise<OrgIssueTypeInfo>; }

(org, input) => Promise<OrgIssueTypeInfo>

(org) => Promise<OrgIssueTypeInfo[]>

(org, id, input) => Promise<OrgIssueTypeInfo>

{ createLabel: (repo, body) => Promise<GitHubLabel>; deleteLabel: (repo, name) => Promise<void>; listLabels: (repo) => Promise<GitHubLabel[]>; updateLabel: (repo, name, body) => Promise<GitHubLabel>; }

(repo, body) => Promise<GitHubLabel>

(repo, name) => Promise<void>

(repo) => Promise<GitHubLabel[]>

(repo, name, body) => Promise<GitHubLabel>

{ createPages: (repo, payload) => Promise<GitHubPages>; getPages: (repo) => Promise<GitHubPages | null>; updatePages: (repo, payload) => Promise<void>; }

(repo, payload) => Promise<GitHubPages>

(repo) => Promise<GitHubPages | null>

(repo, payload) => Promise<void>

{ getValues: (repo) => Promise<RepoPropertyValue[]>; orgSchema: (org) => Promise<OrgProperty[]>; setOrgProperty: (org, property) => Promise<OrgProperty>; setProperties: (repo, values) => Promise<void>; }

(repo) => Promise<RepoPropertyValue[]>

(org) => Promise<OrgProperty[]>

(org, property) => Promise<OrgProperty>

(repo, values) => Promise<void>

{ createPullRequest: (repo, input) => Promise<GitHubPullRequest>; createReview: (repo, number, input) => Promise<GitHubPullRequestReview>; getPullRequest: (repo, number) => Promise<GitHubPullRequest>; listCommits: (repo, number) => Promise<GitHubPullRequestCommit[]>; listFiles: (repo, number) => Promise<GitHubPullRequestFile[]>; listOpenByHead: (repo, branch) => Promise<GitHubPullRequest[]>; listPullRequests: (repo, state) => Promise<GitHubPullRequest[]>; listReviews: (repo, number) => Promise<GitHubPullRequestReview[]>; listReviewThreads: (repo, number) => Promise<ReviewThread[]>; markReadyForReview: (nodeId) => Promise<void>; resolveReviewThread: (threadId) => Promise<void>; updatePullRequest: (repo, number, input) => Promise<GitHubPullRequest>; }

(repo, input) => Promise<GitHubPullRequest>

(repo, number, input) => Promise<GitHubPullRequestReview>

(repo, number) => Promise<GitHubPullRequest>

(repo, number) => Promise<GitHubPullRequestCommit[]>

(repo, number) => Promise<GitHubPullRequestFile[]>

(repo, branch) => Promise<GitHubPullRequest[]>

(repo, state) => Promise<GitHubPullRequest[]>

(repo, number) => Promise<GitHubPullRequestReview[]>

(repo, number) => Promise<ReviewThread[]>

(nodeId) => Promise<void>

(threadId) => Promise<void>

(repo, number, input) => Promise<GitHubPullRequest>

{ getContents: (repo, path) => Promise<GitHubContents>; getRepo: (repo) => Promise<GitHubRepo>; updateRepo: (repo, settings) => Promise<void>; }

(repo, path) => Promise<GitHubContents>

(repo) => Promise<GitHubRepo>

(repo, settings) => Promise<void>

{ createRuleset: (repo, payload) => Promise<GitHubRuleset>; getRuleset: (repo, id) => Promise<GitHubRulesetDetail>; listRulesets: (repo) => Promise<GitHubRuleset[]>; updateRuleset: (repo, id, payload) => Promise<GitHubRuleset>; }

(repo, payload) => Promise<GitHubRuleset>

(repo, id) => Promise<GitHubRulesetDetail>

(repo) => Promise<GitHubRuleset[]>

(repo, id, payload) => Promise<GitHubRuleset>

{ deleteSecret: (repo, scope, name) => Promise<void>; getPublicKey: (repo, scope) => Promise<GitHubPublicKey>; listOrgSecretInfo: (org) => Promise<OrgSecretInfo[]>; listSecrets: (repo, scope) => Promise<string[]>; listSelectedRepositories: (org, name) => Promise<string[]>; putSecret: (repo, scope, name, body) => Promise<void>; }

(repo, scope, name) => Promise<void>

(repo, scope) => Promise<GitHubPublicKey>

(org) => Promise<OrgSecretInfo[]>

(repo, scope) => Promise<string[]>

(org, name) => Promise<string[]>

(repo, scope, name, body) => Promise<void>

{ automatedSecurityFixesEnabled: (repo) => Promise<boolean>; codeScanningDefaultSetupState: (repo) => Promise<string>; disableDefaultCodeScanning: (repo) => Promise<void>; enableAutomatedSecurityFixes: (repo) => Promise<void>; enableCodeScanning: (repo) => Promise<CodeScanningSetupResult>; enableDependencyGraph: (repo) => Promise<void>; enablePrivateVulnerabilityReporting: (repo) => Promise<void>; enableSecretScanning: (repo) => Promise<void>; enableVulnerabilityAlerts: (repo) => Promise<void>; privateVulnerabilityReportingEnabled: (repo) => Promise<boolean>; vulnerabilityAlertsEnabled: (repo) => Promise<boolean>; }

(repo) => Promise<boolean>

(repo) => Promise<string>

(repo) => Promise<void>

(repo) => Promise<void>

(repo) => Promise<CodeScanningSetupResult>

(repo) => Promise<void>

security.enablePrivateVulnerabilityReporting
Section titled “security.enablePrivateVulnerabilityReporting”

(repo) => Promise<void>

(repo) => Promise<void>

(repo) => Promise<void>

security.privateVulnerabilityReportingEnabled
Section titled “security.privateVulnerabilityReportingEnabled”

(repo) => Promise<boolean>

(repo) => Promise<boolean>

{ listCommitStatuses: (repo, ref) => Promise<GitHubCommitStatus[]>; }

(repo, ref) => Promise<GitHubCommitStatus[]>

{ addRepo: (org, teamSlug, owner, repo, permission) => Promise<void>; listForRepo: (repo) => Promise<RepoTeam[]>; members: (org, teamSlug) => Promise<TeamMember[]>; }

(org, teamSlug, owner, repo, permission) => Promise<void>

(repo) => Promise<RepoTeam[]>

(org, teamSlug) => Promise<TeamMember[]>

{ setTopics: (repo, names) => Promise<void>; }

(repo, names) => Promise<void>

{ getCurrentUser: () => Promise<GitHubUser>; getCurrentUserWithExpiry(): Promise<GitHubUserWithExpiry>; }

() => Promise<GitHubUser>

() => Promise<GitHubUserWithExpiry>

{ createVariable: (repo, scope, body) => Promise<void>; deleteVariable: (repo, scope, name) => Promise<void>; getVariable: (repo, scope, name) => Promise<GitHubVariable | null>; listVariables: (repo, scope) => Promise<GitHubVariable[]>; updateVariable: (repo, scope, name, body) => Promise<void>; }

(repo, scope, body) => Promise<void>

(repo, scope, name) => Promise<void>

(repo, scope, name) => Promise<GitHubVariable | null>

(repo, scope) => Promise<GitHubVariable[]>

(repo, scope, name, body) => Promise<void>

{ createWorkflowDispatch: (repo, workflowFile, ref, inputs?) => Promise<void>; getRun: (repo, id) => Promise<GitHubWorkflowRun>; listJobs: (repo, runId) => Promise<GitHubWorkflowJob[]>; listRuns: (repo, filter?) => Promise<GitHubWorkflowRun[]>; }

(repo, workflowFile, ref, inputs?) => Promise<void>

(repo, id) => Promise<GitHubWorkflowRun>

(repo, runId) => Promise<GitHubWorkflowJob[]>

(repo, filter?) => Promise<GitHubWorkflowRun[]>

IssuesOptions

GitHubIssues

readonly key: "issues"

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:80

Capability key, always "issues".

Issues.key


readonly providerName: "github" = "github"

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:82

Provider name, always "github".

Issues.providerName

comment(key, body): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:261

Adds a comment to the issue with the given key.

string

string

Promise<void>

Issues.comment


create(input): Promise<{ dropped?: string[]; key: string; }>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:190

Creates an issue and returns its key as #<number>; the milestone is resolved from its title. Type, Priority, Effort, the dates, the parent and the blockers are set after the issue exists; what GitHub refuses of them comes back in dropped, never as a failure, because the issue is made by then and its key must not be lost.

IssueCreateInput

Promise<{ dropped?: string[]; key: string; }>

Issues.create


createType(type): Promise<IssueTypeInfo>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:364

Makes a Type; never replaces one that exists. Throws when it cannot (no token, a refusal). Optional.

IssueTypeDeclaration

Promise<IssueTypeInfo>

Issues.createType


doctor(): Promise<TrackerDoctorReport>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:269

Checks the authenticated user, the repo and the label-backed lifecycle slots, and reports what resolves.

Promise<TrackerDoctorReport>

Issues.doctor


export(selector, info?): Promise<IssueRecord[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:343

Reads issues with their comments, priority label, parent and blockers, for holocron migrate.

IssueSelector

ExportInfo

Promise<IssueRecord[]>

Issues.export


get(key): Promise<Issue>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:177

Fetches one issue by its key.

string

Promise<Issue>

Issues.get


getMyself(): Promise<TrackerUser>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:106

Currently-authenticated user.

Promise<TrackerUser>

Issues.getMyself


import(records, options?): Promise<ImportResult[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:348

Makes the records as issues; one already made by an earlier run is skipped.

IssueRecord[]

ImportOptions

Promise<ImportResult[]>

Issues.import


listTypes(): Promise<IssueTypeInfo[] | undefined>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:359

The organization’s issue Types (#2512). undefined when they cannot be read (no token for it). A tracker with no Type (Linear) leaves the three Type methods out. Optional.

Promise<IssueTypeInfo[] | undefined>

Issues.listTypes


search(filter): Promise<Issue[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:123

Searches the repo’s issues, newest update first, leaving out pull requests.

With filter.text, the issues are paged (newest update first, 100 a page, at most 20 pages) and compared client-side, without regard to case, until limit matches are found or the issues run out. GitHub’s issue search (GET /search/issues) is deliberately not used: it indexes the words of a body, so punctuation and an HTML comment such as <!-- holocron:idea notes/a.md --> cannot be relied on to match, it is limited to 30 requests a minute and it is eventually consistent (an issue made a moment ago may be missing). Paging has none of those limits, at the cost of reading up to 20 pages of a very large repository.

IssueSearchFilter

Promise<Issue[]>

Issues.search


sync(records, options?): Promise<SyncResult[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:353

Like import, and it also updates what an earlier import or sync made, for holocron sync issues.

IssueRecord[]

ImportOptions

Promise<SyncResult[]>

Issues.sync


transition(key, slot): Promise<LifecycleResult>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:222

Idempotent — transitioned: false if the issue is already at the target.

string

LifecycleSlot

Promise<LifecycleResult>

Issues.transition


update(key, patch): Promise<IssueUpdateResult>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:210

Changes an issue; see updateGitHubIssue.

string

IssuePatch

Promise<IssueUpdateResult>

Issues.update


updateType(id, patch): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/issues.ts:376

Sets a Type’s description and colour, keeping its name and whether it is enabled. Nothing else changes. Optional.

string | number

string

string

Promise<void>

Issues.updateType