Skip to content

GitHubSource

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

The GitHub implementation of the source capability: repo settings, rulesets, branch protection, security features and local workflow files.

  • Source

new GitHubSource(client, opts): GitHubSource

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:95

{ 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[]>

SourceOptions

GitHubSource

readonly key: "source"

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

Capability key, always "source".

Source.key


readonly providerName: "github" = "github"

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

Provider name, always "github".

Source.providerName

addOrgPropertyValues(name, values): Promise<string[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:270

Adds the values the organization’s custom property name does not allow yet and returns the ones it added. Never removes or reorders a value, and keeps the rest of the definition as it is. Rejects when the property does not exist or the token cannot write it (the organization’s Custom properties: admin). Optional.

string

string[]

Promise<string[]>

Source.addOrgPropertyValues


checkPropertyValues(values): Promise<string[] | undefined>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:280

What is wrong with values when compared with the organization’s custom property definitions: one sentence per value a single_select or multi_select property does not allow, per property the organization does not define, or per true_false property that is not true or false. Empty when every value is allowed, and undefined when the definitions cannot be read (the token lacks the organization’s custom properties permission). Read-only. Optional — providers without custom properties omit this.

Record<string, string | string[]>

Promise<string[] | undefined>

Source.checkPropertyValues


configurePages(config, token): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:481

Enable or update GitHub Pages for the repository. Idempotent: POST to create, PUT to update existing settings. Requires HOLOCRON_DEPLOY_TOKEN (pages:write + repo scope) — passed explicitly because it is a different PAT from the main admin token. Optional — providers without a Pages concept omit this.

PagesConfig

string

Promise<void>

Source.configurePages


countIssues(query, repo?): Promise<number>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:367

How many issues a search matches in this repository (or in repo, as owner/name): the text is the filter of a saved view (is:issue state:open is:blocked), and the provider scopes it to the repository. Reads only the count. Rejects with a ProviderApiError of status 422 when the search refuses the text. Used by doctor repo for repo.views. Optional.

string

string

Promise<number>

Source.countIssues


createCheckRun(sha, name, write, repo?): Promise<number>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:473

Posts a check run on a commit and returns its id: in progress while the verdict can still change, completed once it is final. Optional — providers that cannot post checks omit this.

string

string

SourceCheckRunWrite

string

Promise<number>

Source.createCheckRun


createPullRequest(input, repo?): Promise<PullRequestResult>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:444

Opens a pull request, a draft by default, and links it to an issue with a Closes or Refs line in the body. Idempotent: an open pull request for the same head is returned (created: false), never a second one. Labels, assignees, milestone and projects are applied after it is made, and what the provider cannot apply comes back in dropped. Optional — providers without pull requests omit this.

PullRequestInput

string

Promise<PullRequestResult>

Source.createPullRequest


createRuleset(payload): Promise<Ruleset>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:158

Creates a ruleset from the given payload.

Record<string, unknown>

Promise<Ruleset>

Source.createRuleset


deleteBranch(name, repo?): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:422

Delete one branch on the remote. Idempotent: a branch that is already gone is success, not an error. Optional — providers that cannot delete a branch omit this.

string

string

Promise<void>

Source.deleteBranch


disableDefaultCodeScanning(): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:196

Disables CodeQL default setup. Required when the repo uses an advanced CodeQL workflow instead — GitHub rejects SARIF from advanced workflows while default setup is active.

Promise<void>

Source.disableDefaultCodeScanning


enableAutomatedSecurityFixes(): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:182

Enables Dependabot automated security fixes.

Promise<void>

Source.enableAutomatedSecurityFixes


enableCodeScanning(): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:191

Enables CodeQL default setup with the extended query suite and threat_model: all (scans both remote and local exploit paths). Triggers a new analysis run; returns the run id.

Promise<string>

Source.enableCodeScanning


enableDependencyGraph(): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:200

Enables the dependency graph and automatic dependency snapshot submission. Also enables secret-scanning validity checks and non-provider pattern detection — these require GitHub Advanced Security at the org level; the call is accepted but may be a no-op until that is configured.

Promise<void>

Source.enableDependencyGraph


enablePrivateVulnerabilityReporting(): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:205

Enables private vulnerability reporting.

Promise<void>

Source.enablePrivateVulnerabilityReporting


enableSecretScanning(): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:187

Enables secret scanning.

Promise<void>

Source.enableSecretScanning


enableVulnerabilityAlerts(): Promise<void>

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

Enables Dependabot vulnerability alerts.

Promise<void>

Source.enableVulnerabilityAlerts


ensureLabels(labels): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:258

Make the labels that are missing and leave every existing one exactly as it is (name case aside): no colour or description is patched and nothing is deleted. For per-repo label families such as area:<name>, which are not in the canonical set syncLabels owns. Optional — providers that have no label concept omit this.

readonly LabelDef[]

Promise<string>

Source.ensureLabels


ensureRelaySource(input): Promise<EnsureRelaySourceResult>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:125

Makes the GitHub webhook for a relay source: on one repository with the admin token, or on the organization (options.org) with the organization token. Found by URL, events and active brought in line, nothing deleted.

EnsureRelaySourceInput

Promise<EnsureRelaySourceResult>

Source.ensureRelaySource


getOrgPropertyValues(name): Promise<string[] | undefined>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:266

The values the organization’s single_select or multi_select custom property name allows, or undefined when the definitions cannot be read, the property does not exist or it takes any value. Read-only. Optional.

string

Promise<string[] | undefined>

Source.getOrgPropertyValues


getProperties(): Promise<Record<string, string | string[]>>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:357

The repository’s custom property values as they are now, by property name. A property that is not set is left out. Read-only. Optional — providers without custom properties omit this.

Promise<Record<string, string | string[]>>

Source.getProperties


getPullRequest(number, repo?): Promise<PullRequest>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:399

Fetch a pull request by number. The repo override lets callers look up a PR in a different repo than the one the plugin is scoped to — useful when the cleanup command targets another repo’s PR (e.g. docs PR from the holocron repo context). Optional — providers without a PR concept omit this.

number

string

Promise<PullRequest>

Source.getPullRequest


getPullRequestChecks(number, repo?, required?): Promise<PullRequestChecks>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:456

The verdict of the aggregate check (ci / Required checks) on a pull request’s newest commit, read each time it is asked, with the checks that failed. close work reads it before it marks a pull request ready. Optional — providers without checks omit this.

With required (a repo whose ci.aggregate is none: nothing posts the aggregate) the provider reads the commit’s check runs and commit statuses instead and answers whether those required checks are green, whatever the optional ones do (their failures are still listed, with required: false). Without it the read is the aggregate’s, as it always was.

number

string

SourceRequiredChecks

Promise<PullRequestChecks>

Source.getPullRequestChecks


getRepo(): Promise<RepoRef>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:145

Returns the repo’s owner, name and default branch.

Promise<RepoRef>

Source.getRepo


getRepoInfo(): Promise<SourceRepoInfo>

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

The repository’s description, homepage, default branch, topics and merge/feature settings as they are now. Read-only. Optional — providers that cannot report them omit this.

Promise<SourceRepoInfo>

Source.getRepoInfo


getRulesetDetail(id): Promise<SourceRulesetDetail>

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

One ruleset in full: its enforcement, the types of its rules and the status checks it requires. Read-only. Optional — providers without rulesets omit this.

number

Promise<SourceRulesetDetail>

Source.getRulesetDetail


getSecurity(): Promise<SourceSecurity>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:380

Which security features are on. A feature the provider cannot report (the token cannot see it, the plan lacks it) is left out rather than reported as off. Read-only. Optional — providers without security toggles omit this.

Promise<SourceSecurity>

Source.getSecurity


inspectRelaySource(input): Promise<RelaySourceState>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:130

Reads the relay source’s webhook back, changing nothing. GitHub never returns the secret, so hasSecret is left out.

InspectRelaySourceInput

Promise<RelaySourceState>

Source.inspectRelaySource


listBranches(repo?): Promise<SourceBranch[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:415

Every branch on the remote, with the commit each points at. Optional — providers without branches omit this.

string

Promise<SourceBranch[]>

Source.listBranches


listCheckRuns(ref, repo?): Promise<SourceCheckRun[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:465

Every check run on a commit, whoever posted it, as the aggregate reads them (reconcile ci). Optional — providers without checks omit this.

string

string

Promise<SourceCheckRun[]>

Source.listCheckRuns


listCommitStatuses(ref, repo?): Promise<SourceCommitStatus[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:469

The commit statuses on a commit, newest first (a context that posted twice appears twice). Optional — providers without commit statuses omit this.

string

string

Promise<SourceCommitStatus[]>

Source.listCommitStatuses


listLabels(): Promise<LabelDef[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:362

The repository’s labels as they are now. Read-only. Optional — providers without labels omit this.

Promise<LabelDef[]>

Source.listLabels


listOrgVariables(org): Promise<Record<string, { value: string; visibility: "private" | "all" | "selected"; }>>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:341

The organization’s Actions variables as they are now, by name, with each value and the repositories that can read it (selected is a list this interface does not manage). Read-only. Throws MissingTokenError when the provider has no token that can read them. Optional — providers without organization variables omit this.

string

Promise<Record<string, { value: string; visibility: "private" | "all" | "selected"; }>>

Source.listOrgVariables


listPullRequestCommits(number, repo?): Promise<string[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:433

The commit SHAs of one pull request, in commit order. A squash-merged branch is not an ancestor of the base, so this is how a local tip is matched to a PR whose head commit is not in the checkout. Optional — providers without a PR concept omit this.

number

string

Promise<string[]>

Source.listPullRequestCommits


listPullRequestFiles(number, repo?): Promise<string[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:437

The paths one pull request changes, as the repository spells them (a renamed file lists both its new and its old path), each once. A provider that caps the list returns what it has. update work reads the changed folders from it for the area labels. Optional — providers without a PR concept omit this.

number

string

Promise<string[]>

Source.listPullRequestFiles


listPullRequests(state, repo?): Promise<PullRequest[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:403

Every pull request in one state, newest first. closed includes the merged ones (merged tells them apart). Optional — providers without a PR concept omit this.

"closed" | "open"

string

Promise<PullRequest[]>

Source.listPullRequests


listRulesets(): Promise<Ruleset[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:151

Lists the repo’s rulesets.

Promise<Ruleset[]>

Source.listRulesets


listTeamAccess(): Promise<object[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:371

The teams that have access to the repository, with each team’s permission. Read-only. Optional — providers without a team concept omit this.

Promise<object[]>

Source.listTeamAccess


listVariables(): Promise<Record<string, string>>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:336

The repository’s Actions variables as they are now, by name, with their values. Read-only. Optional — providers without Actions variables omit this.

Promise<Record<string, string>>

Source.listVariables


listWorkflowFiles(): Promise<string[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:212

Lists the .yml and .yaml files in .github/workflows, sorted by name; empty when the folder is missing.

Promise<string[]>

Source.listWorkflowFiles


markReady(number, repo?): Promise<boolean>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:452

Takes a draft pull request out of draft. Idempotent: one that is not a draft (or is closed or merged) is left as it is and reported as false. Optional — providers without drafts omit this.

number

string

Promise<boolean>

true when the pull request was a draft and now is not.

Source.markReady


protectBranch(branch, payload): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:172

Classic branch protection — fallback for private repos on free plans where the Rulesets API (requires Team+) returns 403.

string

Record<string, unknown>

Promise<void>

Source.protectBranch


readFile(path, repo?): Promise<SourceFile | null>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:294

Read one file from a repository (default: this one), with the version a later writeFile must hand back. null when the file does not exist. Optional — providers that cannot read file contents omit this.

string

string = ...

Promise<SourceFile | null>

Source.readFile


readPullRequestState(number, repo?, required?): Promise<PullRequestState | undefined>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:407

One pull request as the PR forum’s post is rendered from it (holocron sync prs): the pull request, its reviews and the checks of its head commit, read now. undefined when the repository has no such pull request. With required (a repo whose ci.aggregate is none) the “CI” of the state is those required checks’ verdict, else the aggregate’s. Optional — providers without a PR concept omit this.

number

string

SourceRequiredChecks

Promise<PullRequestState | undefined>

Source.readPullRequestState


readWorkflowFile(name): Promise<string | null>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:223

Reads a workflow file’s text, or null when it does not exist.

string

Promise<string | null>

Source.readWorkflowFile


removeWorkflowFile(name): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:239

Removes a workflow file; a file that is already gone is not an error.

string

Promise<void>

Source.removeWorkflowFile


syncDescription(description): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:384

Set the repository description. Optional — providers that don’t support setting descriptions omit this.

string

Promise<string>

Source.syncDescription


syncHomepage(homepage): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:389

Set the repository homepage URL (the “Website” field on the repo landing page). Optional — providers that don’t support setting a homepage omit this.

string

Promise<string>

Source.syncHomepage


syncLabels(canonical, stale): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:254

Idempotently sync repo labels to a canonical set. Creates missing labels, patches color/description drift, deletes stale labels. Optional — providers that have no label concept omit this.

readonly LabelDef[]

readonly string[]

Promise<string>

Source.syncLabels


syncOrgVariables(org, variables, opts?): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:323

The same for the organization’s variables, each with the repositories that can read it (all or private). Optional — providers without organization variables omit this.

string

Record<string, { value: string; visibility: "all" | "private"; }>

boolean

boolean

Promise<string>

Source.syncOrgVariables


syncProperties(values): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:262

Set org-level custom property values on the repo. string[] for multi_select properties, plain string for everything else. Optional — providers that don’t support custom properties omit this.

Record<string, string | string[]>

Promise<string>

Source.syncProperties


syncTeams(teams): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:284

Sync GitHub team repository access. String shorthand defaults to push. Optional — providers without a team concept omit this.

TeamEntry[]

Promise<string>

Source.syncTeams


syncTopics(topics): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:312

Replace the repo’s topic set with the supplied list. Optional — providers that don’t support topics omit this.

string[]

Promise<string>

Source.syncTopics


syncVariables(variables, opts?): Promise<string>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:316

Bring the repository’s Actions variables in line with the declared ones: create what is missing, update what differs, leave the rest. With prune, also delete the ones the declaration does not name. With dryRun, read the current state and report what would change without writing. Returns a summary. Optional — providers without Actions variables omit this.

Record<string, string>

boolean

boolean

Promise<string>

Source.syncVariables


teamMembers(teamSlug, org?): Promise<SourceTeamMember[]>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:288

The members of a team in org (default: the repo’s organisation), by the provider’s own stable id (for GitHub, the numeric user id, which survives a rename) and current login. Optional — providers without a team concept omit this.

string

string = ...

Promise<SourceTeamMember[]>

Source.teamMembers


updateCheckRun(id, write, repo?): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:477

Changes a check run this caller posted. A provider that will not reopen a completed run throws. Optional — providers that cannot post checks omit this.

number

SourceCheckRunWrite

string

Promise<void>

Source.updateCheckRun


updatePullRequest(number, patch, repo?): Promise<PullRequestResult>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:448

Changes a pull request: a field not in the patch is left alone and nothing is cleared unless the patch says so. Optional — providers without pull requests omit this.

number

PullRequestPatch

string

Promise<PullRequestResult>

Source.updatePullRequest


updateRepoSettings(settings): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:168

Updates the repo’s settings.

RepoSettings

Promise<void>

Source.updateRepoSettings


updateRuleset(id, payload): Promise<Ruleset>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:163

Updates the ruleset with the given id from the payload.

number

Record<string, unknown>

Promise<Ruleset>

Source.updateRuleset


whoami(): Promise<{ login: string; }>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:139

Auth sanity-check. Throws ProviderApiError on auth failure.

Promise<{ login: string; }>

Source.whoami


writeFile(path, content, opts): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:298

Create or replace one file in a single commit. Pass the version readFile returned when replacing, and leave it out when creating: a write on top of a version that has since changed is refused (throws a ProviderApiError with status 409 or 422), so two writers cannot overwrite each other. Optional — providers that cannot write file contents omit this.

string

string

string

string

string

Promise<void>

Source.writeFile


writeRepoFile(path, contents): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:248

Write an arbitrary file relative to the repo root. Used for provisioning config files that live outside .github/workflows/ (e.g. .github/dependabot.yml).

string

string

Promise<void>

Source.writeRepoFile


writeWorkflowFile(name, contents): Promise<void>

Defined in: plugins/holocron-plugin-github/src/capabilities/source.ts:233

Writes a workflow file, creating .github/workflows first when needed.

string

string

Promise<void>

Source.writeWorkflowFile