Skip to content

Class: GithubIssuesTrackerAdapter<TExternalState> ​

Defined in: github/src/executors/github-issues-tracker.ts:23

Runtime TrackerAdapter implementation for GithubIssuesTrackerNode (github:issues).

Polls open issues from /repos/:owner/:repo/issues across per_page: 100 pages via @octokit/rest (filtering out pull requests) and adds lifecycle state labels non-destructively via issues.addLabels.

Type Parameters ​

Type ParameterDefault typeDescription
TExternalState extends stringstringExternal tracker state string union.

Implements ​

Constructors ​

Constructor ​

ts
new GithubIssuesTrackerAdapter<TExternalState>(
   node, 
   ctx, 
   transport?
): GithubIssuesTrackerAdapter<TExternalState>;

Defined in: github/src/executors/github-issues-tracker.ts:44

Initializes a new GithubIssuesTrackerAdapter bound to node, ctx, and transport.

Resolves node.token lazily on each poll() and setExternalState() call via ctx.resolveEnv.

Parameters ​

ParameterTypeDefault valueDescription
nodeGithubIssuesTrackerNode<GithubIssueRecord, TExternalState>undefinedPassive GitHub Issues tracker AST node.
ctxRuntimeDriverContextundefinedRuntime driver context.
transport?GithubHttpTransportdefaultGithubHttpTransportPluggable GitHub HTTP transport.

Returns ​

GithubIssuesTrackerAdapter<TExternalState>

Methods ​

poll() ​

ts
poll(): Promise<readonly GithubIssueRecord[]>;

Defined in: github/src/executors/github-issues-tracker.ts:63

Polls open issues from /repos/${repo}/issues across 100-item pages and filters out pull requests.

Uses @octokit/rest issues.listForRepo with per_page: 100 and excludes entries with pull_request.

Returns ​

Promise<readonly GithubIssueRecord[]>

Frozen array of normalized GitHub issue records.

Throws ​

If token resolution fails, the repo slug is invalid, or the API payload is malformed.

Implementation of ​

TrackerAdapter.poll


setExternalState() ​

ts
setExternalState(itemKey, state): Promise<void>;

Defined in: github/src/executors/github-issues-tracker.ts:91

Adds the target external state label non-destructively via @octokit/rest issues.addLabels.

Strips any leading '#' prefix from itemKey and preserves existing non-state issue labels.

Parameters ​

ParameterTypeDescription
itemKeystringIssue key such as '#42' or '42'.
stateTExternalStateTarget external state label to apply.

Returns ​

Promise<void>

Resolves once the GitHub issue label has been added.

Throws ​

If token resolution fails, itemKey is not a positive integer, or repo slug is invalid.

Implementation of ​

TrackerAdapter.setExternalState

Released under the MIT License.