gh

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func FindLabelPrefix(issue *github.Issue, prefix string) string

FindLabelPrefix Find an issue with a specific label prefix

func HasLabel

func HasLabel(issue *github.Issue, label string) bool

HasLabel checks if an issue has a specific label

func IsOnMainRepository

func IsOnMainRepository(pr *github.PullRequest) bool

IsOnMainRepository checks if the branch of the Pull Request in on the main repository.

func NewGitHubClient

func NewGitHubClient(ctx context.Context, token string, gitHubURL *url.URL) *github.Client

NewGitHubClient create a new GitHub client

Types

type GHub

type GHub struct {
	// contains filtered or unexported fields
}

GHub GitHub helper

func NewGHub

func NewGHub(ctx context.Context, client *github.Client, dryRun bool, debug bool) *GHub

NewGHub create a new GHub

func (*GHub) AddComment

func (g *GHub) AddComment(pr *github.PullRequest, msg string) error

AddComment add a comment on a PR

func (*GHub) AddLabels

func (g *GHub) AddLabels(issue *github.Issue, repoID types.RepoID, labels ...string) error

AddLabels add some labels on an issue (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

func (g *GHub) RemoveLabel(issue *github.Issue, repoID types.RepoID, label string) error

RemoveLabel remove a label on an issue (PR)

func (*GHub) RemoveLabels

func (g *GHub) RemoveLabels(issue *github.Issue, repoID types.RepoID, labelsToRemove []string) error

RemoveLabels remove some labels on an issue (PR)

Jump to

Keyboard shortcuts

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