{"modulePath":"github.com/jakbytes/version_actions","version":"v1.2.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Functions\n\n```go\nfunc Bool(b bool) *bool\n```\n\n```go\nfunc Int(i int) *int\n```\n\n```go\nfunc String(s string) *string\n```\n\n## Types\n\n```go\ntype Branch struct {\n\tRepositoriesService\n\tRepositoryMetadata RepositoryMetadata\n\tGitService\n\t*github.Branch\n\tCtx  context.Context\n\tName string\n}\n```\nBranch is a struct that contains the RepositoriesService, context, token, owner, name, and branch. It is used to interact with the GitHub API in the context of a specific repository.\n\n```go\nfunc (b *Branch) AddFiles(files []File) (newTreeSHA string, parentCommitSHA string, err error)\n```\nAddFiles adds multiple files to a branch and returns the new tree SHA and parent commit SHA\n\n```go\nfunc (b *Branch) CommitChanges(newTreeSHA, parentCommitSHA, commitMessage string) error\n```\n\n```go\nfunc (b *Branch) Commits(perPage int) CommitIterator\n```\n\n```go\nfunc (b *Branch) GetCommitsSinceCommit(hash *string) (map[string]*github.RepositoryCommit, error)\n```\nGetCommitsSinceCommit returns a map of commits from the hash commit to the latest commit, if hash is nil, it will return all commits on the current branch\n\n```go\nfunc (b *Branch) GetDistinctCommits(base string) (commits map[string]*github.RepositoryCommit, err error)\n```\nGetDistinctCommits returns a map of unique commits from the base branch to the head branch\n\nParameters:\n\n  - base: The base branch to compare against\n\nReturns:\n\n  - map\\[string]\\*github.RepositoryCommit: A map of unique commits between the base and current branch\n  - error: An error if one occurred\n\n```go\nfunc (b *Branch) GetLastCommitMessage() (string, error)\n```\nGetLastCommitMessage retrieves the last commit message from the branch\n\n```go\nfunc (b *Branch) Reset(sha *string) error\n```\n\n```go\ntype BranchNotFound struct {\n\tName string\n}\n```\n\n```go\nfunc (e BranchNotFound) Error() string\n```\n\n```go\ntype Client struct {\n\tCtx          context.Context\n\tPullRequests PullRequestsService\n\tRepositories RepositoriesService\n\tGit          GitService\n\tRepositoryMetadata\n}\n```\nClient is a struct that contains the go-github client and the repository metadata to interact with the GitHub API.\n\n```go\nfunc NewClient(ctx context.Context, token, owner, name string) *Client\n```\n\n```go\nfunc (c *Client) CreatePullRequest(head, base string, title string, body changelog.Markdown, draft bool) (*github.PullRequest, error)\n```\n\n```go\nfunc (c *Client) EditPullRequest(head, base, title string, body changelog.Markdown) (*github.PullRequest, error)\n```\n\n```go\nfunc (c *Client) GetPullRequest(head string, base string) (*github.PullRequest, error)\n```\n\n```go\nfunc (c *Client) Repository() *Repository\n```\n\n```go\nfunc (c *Client) SetPullRequest(head, base, title string, draft bool, composeBody func(body *string) (changelog.Markdown, error)) error\n```\n\n```go\ntype Commit = github.Commit\n```\n\n```go\ntype CommitAuthor = github.CommitAuthor\n```\n\n```go\ntype CommitIterator struct {\n\t*Branch\n\t// contains filtered or unexported fields\n}\n```\nCommitIterator iterates over commits in a branch.\n\n```go\nfunc (b *CommitIterator) Commits() []*github.RepositoryCommit\n```\nCommits returns the current batch of commits.\n\n```go\nfunc (b *CommitIterator) Err() error\n```\nErr returns the last error encountered by the iterator.\n\n```go\nfunc (b *CommitIterator) Next() bool\n```\nNext loads the next batch of commits if needed and advances the iterator.\n\n```go\ntype CommitsComparison = github.CommitsComparison\n```\n\n```go\ntype File struct {\n\tPath    string\n\tContent string\n}\n```\n\n```go\ntype GitService interface {\n\tCreateRef(ctx context.Context, owner string, repo string, ref *github.Reference) (*github.Reference, *github.Response, error)\n\tUpdateRef(ctx context.Context, owner string, repo string, ref *github.Reference, force bool) (*github.Reference, *github.Response, error)\n\tCreateBlob(ctx context.Context, owner string, repo string, blob *github.Blob) (*github.Blob, *github.Response, error)\n\tCreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*github.TreeEntry) (*github.Tree, *github.Response, error)\n\tCreateCommit(ctx context.Context, owner string, repo string, commit *Commit, opts *github.CreateCommitOptions) (*Commit, *github.Response, error)\n}\n```\n\n```go\ntype MultiplePullRequestsFoundError struct {\n\tHead string\n\tBase string\n}\n```\n\n```go\nfunc (e MultiplePullRequestsFoundError) Error() string\n```\n\n```go\ntype NoPrereleaseVersionFound struct{}\n```\n\n```go\nfunc (e NoPrereleaseVersionFound) Error() string\n```\n\n```go\ntype NoPullRequestFoundError struct {\n\tHead string\n\tBase string\n}\n```\n\n```go\nfunc (e NoPullRequestFoundError) Error() string\n```\n\n```go\ntype NoReleaseVersionFound struct{}\n```\n\n```go\nfunc (e NoReleaseVersionFound) Error() string\n```\n\n```go\ntype PullRequest = github.PullRequest\n```\n\n```go\ntype PullRequestBranch = github.PullRequestBranch\n```\n\n```go\ntype PullRequestsService interface {\n\tCreate(ctx context.Context, owner string, repo string, newPR *github.NewPullRequest) (*github.PullRequest, *github.Response, error)\n\tList(ctx context.Context, owner string, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)\n\tEdit(ctx context.Context, owner string, repo string, number int, pull *github.PullRequest) (*github.PullRequest, *github.Response, error)\n}\n```\nPullRequestsService is an interface abstracting operations supported by go-github's github.PullRequestsService\n\n```go\ntype RepositoriesService interface {\n\tCompareCommits(ctx context.Context, owner string, repo string, base string, head string, opts *github.ListOptions) (*github.CommitsComparison, *github.Response, error)\n\tListCommits(ctx context.Context, owner string, repo string, opt *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)\n\tListTags(ctx context.Context, owner string, repo string, opt *github.ListOptions) ([]*github.RepositoryTag, *github.Response, error)\n\tGetBranch(ctx context.Context, owner string, repo string, branch string, maxRedirects int) (*github.Branch, *github.Response, error)\n\tGet(ctx context.Context, owner string, repo string) (*github.Repository, *github.Response, error)\n}\n```\nRepositoriesService is an interface abstracting operations supported by go-github's github.RepositoriesService\n\n```go\ntype Repository struct {\n\tGitService\n\tRepositoriesService\n\tRepositoryMetadata RepositoryMetadata\n\n\tCtx context.Context\n\t// contains filtered or unexported fields\n}\n```\nRepository is a struct that contains the RepositoriesService, context, token, owner, and name. It is used to interact with the GitHub API in the context of a specific repository.\n\n```go\nfunc (r *Repository) Branch(name string) (b *Branch, err error)\n```\nBranch returns a Branch struct that contains the GitHub client, context, token, owner, name, and branch. After validating that the branch exists, it will return a Branch struct that can be used to interact with the GitHub API.\n\n```go\nfunc (r *Repository) CreateBranch(name string, sha *string) (branch *Branch, err error)\n```\nCreateBranch creates a branch with the given name and SHA. If the SHA is nil, the default branch's SHA will be used.\n\n```go\nfunc (r *Repository) DefaultBranch() (branch *Branch, err error)\n```\n\n```go\nfunc (r *Repository) LatestPrereleaseVersion(prereleaseIdentifier string) (*Version, error)\n```\nLatestPrereleaseVersion returns the Version with the highest prerelease tag in the repository with the given prerelease identifier. If there are no prerelease tags, an error is returned. The tags and latest version are cached in the repository struct, so subsequent calls to LatestPrereleaseVersion will not make additional network requests.\n\n```go\nfunc (r *Repository) LatestVersion() (*Version, error)\n```\nLatestVersion returns the Version with the highest release tag in the repository. If there are no release tags, an error is returned. The tags and latest version are cached in the repository struct, so subsequent calls to LatestVersion will not make additional network requests. Invalid semantic version tags are ignored.\n\n```go\nfunc (r *Repository) PreviousVersion() (*Version, error)\n```\nPreviousVersion returns the Version immediately preceding the Version with the highest release tag in the repository. If there are no release tags, an error is returned. The tags and latest version are cached in the repository struct,\n\n\tso subsequent calls to PreviousVersion will not make additional network requests. Invalid semantic version tags are\n\tignored.\n\n```go\nfunc (r *Repository) Tags() (tags []*github.RepositoryTag, err error)\n```\nTags returns the list of tags in the repository. The tags are cached in the repository struct, so subsequent calls to Tags will not make additional network requests.\n\n```go\nfunc (r *Repository) Versions() (*RepositoryVersions, error)\n```\nVersions returns the stable and prerelease versions for the repository. The tags and versions are cached in the repository struct, so subsequent calls to Versions will not make additional network requests. Tags that are not valid semantic versions are ignored.\n\n```go\ntype RepositoryCommit = github.RepositoryCommit\n```\n\n```go\ntype RepositoryMetadata struct {\n\tOwner string\n\tName  string\n}\n```\n\n```go\ntype RepositoryTag = github.RepositoryTag\n```\n\n```go\ntype RepositoryVersions struct {\n\t// contains filtered or unexported fields\n}\n```\nRepositoryVersions contains the stable and prerelease versions for a repository\n\n```go\ntype Timestamp = github.Timestamp\n```\n\n```go\ntype Tree = github.Tree\n```\n\n```go\ntype Version struct {\n\t*semver.Version\n\t*github.RepositoryTag\n}\n```\nVersion is a struct that contains the semantic version and the GitHub RepositoryTag associated with it.\n\n```go\ntype Versions struct {\n\t// contains filtered or unexported fields\n}\n```\nVersions maintains a slice of Version structs and the latest version in the slice\n\n","path":"github.com/jakbytes/version_actions/tools/github","name":"github","synopsis":"","isRedistributable":true}
