Documentation
¶
Overview ¶
Package github provides a client for querying the GitHub API, primarily to check repository metadata such as archive status.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseGitHubRemote ¶
ParseGitHubRemote extracts owner and repo from a GitHub remote URL. Supports both SSH (git@github.com:owner/repo.git) and HTTPS (https://github.com/owner/repo.git) formats.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps GitHub API access.
func NewClient ¶
NewClient creates a GitHub client. It attempts to use authentication from the gh CLI config, falling back to the provided token, falling back to unauthenticated access.
func (*Client) BranchPRInfo ¶ added in v0.6.0
BranchPRInfo returns detailed PR information for a branch. When no PR exists, the returned PRInfo has State set to PRStateNone.
func (*Client) IsArchived ¶
IsArchived checks if a repository is archived on GitHub.
func (*Client) PRMergeMethod ¶ added in v0.10.0
PRMergeMethod determines how a PR was merged by inspecting the merge commit. Returns "merge" for merge commits (2+ parents). Returns "squash" for single-parent commits, which includes both squash-merges and rebase-merges (indistinguishable without additional heuristics).
type PRInfo ¶ added in v0.6.0
type PRInfo struct {
Number int
State PRState
MergedAt time.Time
HeadSHA string
MergeCommitSHA string
}
PRInfo contains detailed information about a pull request for a branch.
type PRState ¶ added in v0.3.0
type PRState string
PRState represents the state of a GitHub pull request for a branch.
const ( // PRStateNone means no PR was found for the branch. PRStateNone PRState = "none" // PRStateOpen means a PR is currently open. PRStateOpen PRState = "open" // PRStateMerged means the PR was merged. PRStateMerged PRState = "merged" // PRStateClosed means the PR was closed without merging. PRStateClosed PRState = "closed" )