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(ctx context.Context, pr *github.PullRequest, msg string) error
- func (g *GHub) AddLabels(ctx context.Context, issue *github.Issue, repoID types.RepoID, ...) error
- func (g *GHub) FindFirstCommit(ctx context.Context, pr *github.PullRequest) (*github.RepositoryCommit, error)
- func (g *GHub) GetAggregatedState(ctx context.Context, pr *github.PullRequest) (string, error)
- func (g *GHub) GetCheckRunsState(ctx context.Context, pr *github.PullRequest) (string, error)
- func (g *GHub) GetStatus(ctx context.Context, pr *github.PullRequest) (string, error)
- func (g *GHub) HasReviewsApprove(ctx context.Context, pr *github.PullRequest, minReview int) error
- func (g *GHub) IsUpToDateBranch(ctx context.Context, pr *github.PullRequest) (bool, error)
- func (g *GHub) RemoveLabel(ctx context.Context, issue *github.Issue, repoID types.RepoID, label string) error
- func (g *GHub) RemoveLabels(ctx context.Context, issue *github.Issue, repoID types.RepoID, ...) 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 ¶
AddComment add a comment on a PR.
func (*GHub) AddLabels ¶
func (g *GHub) AddLabels(ctx context.Context, issue *github.Issue, repoID types.RepoID, labels ...string) error
AddLabels add some labels on an issue (PR).
func (*GHub) FindFirstCommit ¶
func (g *GHub) FindFirstCommit(ctx context.Context, pr *github.PullRequest) (*github.RepositoryCommit, error)
FindFirstCommit find the first commit of a PR.
func (*GHub) GetAggregatedState ¶ added in v1.4.0
GetAggregatedState provide checks status (status + checksSuite).
func (*GHub) GetCheckRunsState ¶ added in v1.4.0
GetCheckRunsState provide checks status (checksRun).
func (*GHub) HasReviewsApprove ¶
HasReviewsApprove check if a PR have the required number of review.
func (*GHub) IsUpToDateBranch ¶
IsUpToDateBranch check if a PR is up to date.
Click to show internal directories.
Click to hide internal directories.