Documentation ¶
Index ¶
- Constants
- func FindLabelPrefix(issue *github.Issue, prefix string) string
- func HasLabel(issue *github.Issue, label string) bool
- func IsOnMainRepository(pr *github.PullRequest) bool
- func NewGitHubClient(ctx context.Context, token string, gitHubURL *url.URL) *github.Client
- type GHub
- func (g *GHub) AddComment(pr *github.PullRequest, msg string) error
- func (g *GHub) AddLabels(issue *github.Issue, repoID types.RepoID, labels ...string) error
- func (g *GHub) FindFirstCommit(pr *github.PullRequest) (*github.RepositoryCommit, error)
- func (g *GHub) GetStatus(pr *github.PullRequest) (string, error)
- func (g *GHub) HasReviewsApprove(pr *github.PullRequest, minReview int) error
- func (g *GHub) IsUpToDateBranch(pr *github.PullRequest) (bool, error)
- func (g *GHub) RemoveLabel(issue *github.Issue, repoID types.RepoID, label string) error
- func (g *GHub) RemoveLabels(issue *github.Issue, repoID types.RepoID, labelsToRemove []string) error
Constants ¶
View Source
const ( MergeMethodSquash = "squash" MergeMethodRebase = "rebase" MergeMethodMerge = "merge" MergeMethodFastForward = "ff" )
Merge Methods
View Source
const ( // Pending Check state Pending = "pending" // Success Check state Success = "success" // Approved Review state Approved = "APPROVED" // Commented Review state Commented = "COMMENTED" // Dismissed Review state Dismissed = "DISMISSED" )
Variables ¶
This section is empty.
Functions ¶
func FindLabelPrefix ¶ added in v1.1.0
FindLabelPrefix Find an issue with a specific label prefix
func IsOnMainRepository ¶
func IsOnMainRepository(pr *github.PullRequest) bool
IsOnMainRepository checks if the branch of the Pull Request in on the main repository.
Types ¶
type GHub ¶
type GHub struct {
// contains filtered or unexported fields
}
GHub GitHub helper
func (*GHub) AddComment ¶
func (g *GHub) AddComment(pr *github.PullRequest, msg string) error
AddComment add a comment on a PR
func (*GHub) FindFirstCommit ¶
func (g *GHub) FindFirstCommit(pr *github.PullRequest) (*github.RepositoryCommit, error)
FindFirstCommit find the first commit of a PR
func (*GHub) GetStatus ¶
func (g *GHub) GetStatus(pr *github.PullRequest) (string, error)
GetStatus provide checks status (CI)
func (*GHub) HasReviewsApprove ¶
func (g *GHub) HasReviewsApprove(pr *github.PullRequest, minReview int) error
HasReviewsApprove check if a PR have the required number of review
func (*GHub) IsUpToDateBranch ¶
func (g *GHub) IsUpToDateBranch(pr *github.PullRequest) (bool, error)
IsUpToDateBranch check if a PR is up to date
func (*GHub) RemoveLabel ¶
RemoveLabel remove a label on an issue (PR)
Click to show internal directories.
Click to hide internal directories.