github

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIBaseURL = "https://api.github.com/"

DefaultAPIBaseURL is the public GitHub REST API base URL.

Variables

This section is empty.

Functions

func New

func New(token string, hc *http.Client) forge.Forge

New creates a GitHub forge backend for github.com.

func NewWithBase

func NewWithBase(baseURL, token string, hc *http.Client) forge.Forge

NewWithBase creates a GitHub forge backend for a GitHub Enterprise instance.

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.

Jump to

Keyboard shortcuts

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