Documentation
¶
Overview ¶
Package github implements backend.Backend against the GitHub REST API.
Index ¶
- type Client
- func (c *Client) CommitURL(sha string) string
- func (c *Client) Publish(ctx context.Context, tag string) error
- func (c *Client) ResolveAuthor(ctx context.Context, sha string) (backend.AuthorReference, bool, error)
- func (c *Client) ResolvePR(ctx context.Context, sha string) (commit.PRReference, bool, error)
- func (c *Client) UpsertDraft(ctx context.Context, req backend.UpsertDraftRequest) error
- type Option
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 implements backend.Backend against the GitHub REST API.
func (*Client) CommitURL ¶
CommitURL implements backend.Backend. GitHub's web UI is always github.com regardless of API base URL (only api.github.com is supported — no Enterprise base-URL override exists for this adapter).
func (*Client) Publish ¶
Publish implements backend.Backend. It flips the draft release matching tag to published. GitHub creates the underlying tag at this point (drafts have none yet), pointed at target_commitish — left unset here, so it defaults to the repository's default branch HEAD at publish time, exactly what the caller expects "publish" to mean.
func (*Client) ResolveAuthor ¶
func (c *Client) ResolveAuthor(ctx context.Context, sha string) (backend.AuthorReference, bool, error)
ResolveAuthor implements backend.Backend using GitHub's "get a commit" endpoint, whose "author" field is the linked GitHub account for the commit's git author email — null when that email isn't tied to any account, in which case ok is false and callers fall back to the plain git author name (ADR-0001).
func (*Client) ResolvePR ¶
ResolvePR implements backend.Backend using GitHub's "list pull requests associated with a commit" endpoint — reliable on GitHub (unlike Gitea, which has no equivalent, or Forgejo, whose equivalent is unreliable; see ADR-0001, where those adapters' ResolvePR always returns ok=false).
func (*Client) UpsertDraft ¶
UpsertDraft implements backend.Backend.