Skip to content

dependabit / monitor/src / GitHubRepoChecker

Class: GitHubRepoChecker

Defined in: packages/monitor/src/checkers/github-repo.ts:9

Contract for all dependency checker implementations.

Remarks

The Monitor selects a checker based on AccessConfig.accessMethod and calls fetch followed by compare. Plugins implement this interface to extend the set of supported access methods.

Use When

Implementing a custom checker for a new access method (e.g., a proprietary API or registry). Register it with Monitor.registerChecker.

Pitfalls

  • fetch should throw only for unrecoverable errors (network failure, auth error). Temporary 5xx responses should be retried inside the implementation to avoid marking the dependency as errored.
  • compare receives the stored previous snapshot and the live current snapshot. Do not assume both snapshots were produced by the same checker version.

Implements

Constructors

Constructor

ts
new GitHubRepoChecker(): GitHubRepoChecker;

Returns

GitHubRepoChecker

Methods

compare()

ts
compare(prev, curr): Promise<ChangeDetection>;

Defined in: packages/monitor/src/checkers/github-repo.ts:128

Compares two snapshots to detect version/state changes

Parameters

ParameterType
prevDependencySnapshot
currDependencySnapshot

Returns

Promise<ChangeDetection>

Implementation of

Checker.compare


fetch()

ts
fetch(config): Promise<DependencySnapshot>;

Defined in: packages/monitor/src/checkers/github-repo.ts:13

Fetches latest release information from a GitHub repository

Parameters

ParameterType
configAccessConfig

Returns

Promise<DependencySnapshot>

Implementation of

Checker.fetch

Released under the MIT License.