Documentation
¶
Index ¶
Constants ¶
const DefaultAPIBaseURL = "https://api.github.com/"
DefaultAPIBaseURL is the public GitHub REST API base URL.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommitResolver ¶ added in v0.9.0
type CommitResolver struct {
// contains filtered or unexported fields
}
CommitResolver resolves GitHub branch, tag, and abbreviated commit refs to full commit SHAs. Full 40-character hexadecimal SHAs are returned without a network request.
func NewCommitResolver ¶ added in v0.9.0
func NewCommitResolver(token string, client *http.Client) *CommitResolver
NewCommitResolver creates a commit resolver for the public GitHub API. The token may be empty for unauthenticated requests. A nil HTTP client uses the default client selected by go-github.
func NewCommitResolverWithBase ¶ added in v0.9.0
func NewCommitResolverWithBase(baseURL, token string, client *http.Client) (*CommitResolver, error)
NewCommitResolverWithBase creates a commit resolver for an explicit GitHub API base URL. The URL must include the API path for GitHub Enterprise and is normalized to end in a slash.
func (*CommitResolver) ResolveCommit ¶ added in v0.9.0
func (r *CommitResolver) ResolveCommit(ctx context.Context, owner, repo, ref string) (string, error)
ResolveCommit returns the full commit SHA for ref in owner/repo. GitHub's commit endpoint dereferences both lightweight and annotated tags.