Documentation
¶
Index ¶
- Variables
- func CommitMessage(message string) (commitMessage githubv4.CommitMessage)
- func CommittableBranch(repo Repo, branch string) githubv4.CommittableBranch
- func ResolveToken(token string) (string, error)
- type Client
- func (c *Client) CreateCommitOnBranchV4(input githubv4.CreateCommitOnBranchInput) (oid githubv4.GitObjectID, url string, err error)
- func (c *Client) CreatePullRequestV4(pullRequest *PullRequest) (err error)
- func (c *Client) CreateRef(ref *github.Reference) (*github.Reference, error)
- func (c *Client) CreateRefV4(input githubv4.CreateRefInput) (err error)
- func (c *Client) CreateTag(name, message, sha string) (*github.Tag, error)
- func (c *Client) DeleteRef(ref string) error
- func (c *Client) FindPullRequestUrl(pullRequest *PullRequest) (found bool, err error)
- func (c *Client) GetCommitSHA(short string) (sha string, err error)
- func (c *Client) GetCommitURL(sha string) string
- func (c *Client) GetFileContentV4(branch string, path string) (content string, ok bool)
- func (c *Client) GetFileHashV4(branch string, path string) (hash string)
- func (c *Client) GetMatchingHeads(commitish string) (headNames []string, err error)
- func (c *Client) GetMatchingTags(sha string) (tagNames []string, err error)
- func (c *Client) GetRef(refName string) (*github.Reference, error)
- func (c *Client) GetRefOidV4(refName string) (oid githubv4.GitObjectID, err error)
- func (c *Client) GetRefSHA(refName, refType string) (sha string, err error)
- func (c *Client) GetRepositoryInfo(branch string) (repository repositoryInfo, err error)
- func (c *Client) GetSHA(commitish, defaultRefType string) (sha string, err error)
- func (c *Client) GetTagObj(name string) (tagObj *TagObj, err error)
- func (c *Client) ResolveCommitish(commitish string) (sha string, err error)
- func (c *Client) UpdateRef(ref *github.Reference, force bool) (*github.Reference, error)
- func (c *Client) UpdateRefName(refName string, targetRef *github.Reference, force bool) (oldHash string, newHash string, err error)
- type PullRequest
- type Repo
- type TagObj
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoMatchingObject = errors.New("no matching object found")
)
Functions ¶
func CommitMessage ¶
func CommitMessage(message string) (commitMessage githubv4.CommitMessage)
func CommittableBranch ¶
func CommittableBranch(repo Repo, branch string) githubv4.CommittableBranch
func ResolveToken ¶
ResolveToken tries to find a GitHub token in the following order: 1. If the token is a file path, read the file and return the contents 2. If the token is non-empty, return the token as is 3. If the token is empty, return an error
Types ¶
type Client ¶
type Client struct { V3 *github.Client V4 *githubv4.Client // contains filtered or unexported fields }
func (*Client) CreateCommitOnBranchV4 ¶
func (c *Client) CreateCommitOnBranchV4(input githubv4.CreateCommitOnBranchInput) (oid githubv4.GitObjectID, url string, err error)
func (*Client) CreatePullRequestV4 ¶
func (c *Client) CreatePullRequestV4(pullRequest *PullRequest) (err error)
func (*Client) CreateRefV4 ¶
func (c *Client) CreateRefV4(input githubv4.CreateRefInput) (err error)
func (*Client) FindPullRequestUrl ¶
func (c *Client) FindPullRequestUrl(pullRequest *PullRequest) (found bool, err error)
func (*Client) GetCommitSHA ¶
GetCommitSHA validates the existence of and retrieves the full SHA of a commit given a short SHA
func (*Client) GetCommitURL ¶
func (*Client) GetFileContentV4 ¶
GetFileContentV4 returns the content and hash of a file on the given branch. It is limited to non-binary files, as the content is returned as a string. If there is any error (including binary file)
func (*Client) GetFileHashV4 ¶
GetFileHashV4 returns the hash of a file on the given branch
func (*Client) GetMatchingHeads ¶
func (*Client) GetMatchingTags ¶
func (*Client) GetRefOidV4 ¶
func (c *Client) GetRefOidV4(refName string) (oid githubv4.GitObjectID, err error)
func (*Client) GetRepositoryInfo ¶
GetRepositoryInfo returns information about a repository
func (*Client) ResolveCommitish ¶
ResolveCommitish resolves a commitish to a full SHA using the GitHub GraphQL API
type PullRequest ¶
type PullRequest struct { RepoId string `json:"-" yaml:"-"` Number int `json:"number,omitzero" yaml:"number,omitempty"` Url string `json:"url" yaml:"url"` Head string `json:"head" yaml:"head"` Base string `json:"base" yaml:"base"` Draft bool `json:"draft" yaml:"draft"` Title string `json:"title" yaml:"title"` Body string `json:"-" yaml:"-"` }