github

package
v0.91.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package github is the ingestion.ForgeClient adapter for GitHub, backed by google/go-github.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidIdentifier = errors.New("identifier must be in owner/name form")

ErrInvalidIdentifier is returned when a repo identifier isn't "owner/name".

View Source
var ErrUnexpectedStatus = errors.New("unexpected status")

ErrUnexpectedStatus is returned when a GitHub API response's status code is neither the expected success code nor 304 Not Modified.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the GitHub-backed ingestion.ForgeClient.

func NewClient

func NewClient(baseURL string) (*Client, error)

NewClient returns a Client. baseURL overrides the GitHub API endpoint (for tests against a fake server); pass "" to use the real GitHub API.

func (*Client) CancelRun added in v0.70.0

func (c *Client) CancelRun(ctx context.Context, req ingestion.RunActionRequest) error

CancelRun implements ingestion.RunActor.

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(ctx context.Context, req ingestion.CreateWebhookRequest) error

CreateWebhook implements ingestion.ForgeClient.

func (*Client) GetRepo added in v0.31.1

GetRepo implements ingestion.ForgeClient. A single-repo lookup, not ListAccessibleRepos filtered client-side -- the authoritative check registration needs, independent of whatever a prior Discover call saw.

func (*Client) JobLogTail added in v0.70.0

JobLogTail implements ingestion.JobLogReader. GitHub answers GET .../actions/jobs/{id}/logs with a 302 to a plain-text download that expires after a minute (https://docs.github.com/en/rest/actions/workflow-jobs), so the redirect is followed here and the download URL never leaves the server. net/http drops the Authorization header on a cross-host redirect, which is what the download wants.

func (*Client) ListAccessibleRepos added in v0.11.0

func (c *Client) ListAccessibleRepos(ctx context.Context, req ingestion.ListAccessibleReposRequest) ([]string, error)

ListAccessibleRepos implements ingestion.ForgeClient. Returns every repo (owner, collaborator, and organization-member repos) the token can see, newest-pushed first, excluding archived, forked, and mirror repos -- none of the three is something the registration UI's picker should ever offer to track.

func (*Client) ListRecentRuns added in v0.4.0

ListRecentRuns implements ingestion.ForgeClient. The run-list request is conditional (If-None-Match/ETag); a 304 short-circuits before any jobs are fetched, since nothing about the run list changed. go-github's typed client isn't used here -- CheckResponse treats a 304 as an API error, so a plain net/http request keeps the conditional-GET contract explicit and testable against a fake server.

Below that per-list check, each individual run gets its own, finer- grained skip: a run present in req.KnownRuns whose status is completed and matches the fresh listing's status and conclusion has nothing new to report, so its jobs aren't refetched at all (see ingestion.RunState's doc comment).

func (*Client) RateLimitFor added in v0.25.0

func (c *Client) RateLimitFor(token string) (ingestion.RateLimitSnapshot, bool)

RateLimitFor implements ingestion.RateLimitReporter.

func (*Client) RerunRun added in v0.70.0

func (c *Client) RerunRun(ctx context.Context, req ingestion.RunActionRequest) error

RerunRun implements ingestion.RunActor. It re-runs only the failed jobs when asked to, the whole run otherwise (https://docs.github.com/en/rest/actions/workflow-runs).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL