Documentation
¶
Overview ¶
Package github is the source-control provider for GitHub and GitHub Enterprise Server.
Index ¶
- type Client
- func (c *Client) ClosePullRequest(ctx context.Context, number int) error
- func (c *Client) CommitStatus(ctx context.Context, sha, name string) (string, error)
- func (c *Client) CreatePullRequest(ctx context.Context, head, base, title, body string) (sourcecontrol.PullRequest, error)
- func (c *Client) Credentials(context.Context) (string, string, error)
- func (c *Client) Identity(ctx context.Context) (sourcecontrol.Identity, error)
- func (c *Client) PullRequests(ctx context.Context, state, head string) ([]sourcecontrol.PullRequest, error)
- func (c *Client) SetCommitStatus(ctx context.Context, sha string, status sourcecontrol.Status) error
- func (c *Client) UpdatePullRequest(ctx context.Context, number int, title, body string) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is one repository on one GitHub host.
func New ¶
New binds the repository behind an origin URL to its host's API. Tokens are minted within ctx.
func (*Client) ClosePullRequest ¶
func (*Client) CommitStatus ¶
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(ctx context.Context, head, base, title, body string) (sourcecontrol.PullRequest, error)
func (*Client) Credentials ¶
Credentials presents the access token as the git password.
func (*Client) Identity ¶
Identity derives the noreply identity GitHub attributes commits to: the App's bot user, or the token's user.
func (*Client) PullRequests ¶
func (c *Client) PullRequests(ctx context.Context, state, head string) ([]sourcecontrol.PullRequest, error)
PullRequests lists pull requests in a state, page by page.
func (*Client) SetCommitStatus ¶
func (c *Client) SetCommitStatus(ctx context.Context, sha string, status sourcecontrol.Status) error
SetCommitStatus records a status, keeping the description within the 140 characters GitHub stores.
type Config ¶
type Config struct {
// ClientID, InstallationID and PrivateKey identify a GitHub App and its
// installation on the repository's owner; short-lived installation
// tokens are minted from them as needed. The installation ID is a
// number in YAML or a string when it comes from the environment.
ClientID string `json:"client_id,omitempty"`
InstallationID json.Number `json:"installation_id,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
// Token is a personal access token used instead of an App.
Token string `json:"token,omitempty"`
}
Config is the provider configuration a Project declares under reconcile.source_control.config: a GitHub App installation, or a token.