github

package
v0.4.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 18 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 adapts GitHub repositories and pull requests to forge contracts.

It uses go-github for tag and release catalogs, repository metadata, and pull request observation and writes. The shared internal/github client supplies authentication and transport policy; upstream and publish interpret the observations for a contribution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*githubapi.Client
	// GitExecutable reads tags with plain git when the API cannot; empty
	// finds git on PATH.
	GitExecutable string
}

func (*Client) Create

func (*Client) Document

func (c *Client) Document(ctx context.Context, address string, headers http.Header) ([]byte, bool, error)

Document fetches a livecheck URL on the GitHub API through the client, so the user's credentials and the rate-limit handling apply, sending the caller's headers, which are Base's curl fetch's, in place of the SDK's user agent, Accept, and API version. The API lays its JSON out by those headers, and the maintainers' expressions are written against the indented form MacPorts receives; the SDK's own headers get the compact form. A URL off the API is not served. The body is bounded like a plain listing.

func (*Client) Inspect

Inspect reports mergeability, the latest review from each reviewer, check runs, and commit statuses for the pull request's current head. It reads only; nothing here reruns, comments, or merges.

func (*Client) Login added in v0.4.0

func (c *Client) Login(ctx context.Context) (forge.Login, error)

Login is who the client acts as, asked of GitHub, and where its token comes from (githubapi.Client.LoginStatus).

func (*Client) MarkReady

MarkReady takes a draft pull request out of draft, so it is ready for review, and reports it as it then is. One already ready is left alone.

func (*Client) NameFromRemote

func (c *Client) NameFromRemote(remote string) (string, error)

NameFromRemote is the repository a remote's URL names on GitHub.

func (*Client) Observe

func (*Client) OpenPullRequests

func (c *Client) OpenPullRequests(ctx context.Context, repository, port string) ([]forge.PullRequestSummary, error)

OpenPullRequests finds a repository's open pull requests whose titles contain a word, as GitHub's search reads it; which of them name a port is MacPorts' subject rule, the caller's (commitmsg.SubjectPorts; the architecture review's H2).

func (*Client) Permission

func (c *Client) Permission(ctx context.Context, repository, login string) (string, error)

Permission is a person's role on a repository: admin, maintain, write, triage, read, or none.

func (*Client) PostReview

func (c *Client) PostReview(ctx context.Context, input forge.ReviewInput) (string, error)

PostReview posts a review on a pull request at the commit it reviewed, and returns the review's address.

func (*Client) ReadPullRequests added in v0.4.0

func (c *Client) ReadPullRequests(ctx context.Context, refs []forge.PullRequestRef) ([]forge.PullRequestReading, error)

ReadPullRequests reads the pull requests with GitHub's GraphQL API, twenty-five a request, where Observe and Inspect take about five requests each: the pull-request half of spending less of GitHub's allowance (the SQL study's O8). One GitHub hasn't is not Found; one with more reviews or checks than a reading takes is Partial.

func (*Client) Repository

func (c *Client) Repository(instance, name string) (forge.Repository, error)

Repository validates a GitHub owner/name without making a network request.

func (*Client) RepositoryInfo

func (c *Client) RepositoryInfo(ctx context.Context, name string) (forge.RepositoryInfo, error)

func (*Client) RequestReviewers

func (c *Client) RequestReviewers(ctx context.Context, ref forge.PullRequestRef, logins []string) error

RequestReviewers asks people to review a pull request again, as GitHub's "re-request review" does.

func (*Client) Update

Jump to

Keyboard shortcuts

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