gh

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 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(client *github.Client, dryRun, debug bool) *GHub

NewGHub create a new GHub.

func (*GHub) AddComment

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

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

func (g *GHub) GetAggregatedState(ctx context.Context, pr *github.PullRequest) (string, error)

GetAggregatedState provide checks status (status + checksSuite).

func (*GHub) GetCheckRunsState added in v1.4.0

func (g *GHub) GetCheckRunsState(ctx context.Context, pr *github.PullRequest) (string, error)

GetCheckRunsState provide checks status (checksRun).

func (*GHub) GetStatus

func (g *GHub) GetStatus(ctx context.Context, pr *github.PullRequest) (string, error)

GetStatus provide checks status (status).

func (*GHub) HasReviewsApprove

func (g *GHub) HasReviewsApprove(ctx context.Context, pr *github.PullRequest, minReview int) error

HasReviewsApprove check if a PR have the required number of review.

func (*GHub) IsUpToDateBranch

func (g *GHub) IsUpToDateBranch(ctx context.Context, pr *github.PullRequest) (bool, error)

IsUpToDateBranch check if a PR is up to date.

func (*GHub) RemoveLabel

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

RemoveLabel remove a label on an issue (PR).

func (*GHub) RemoveLabels

func (g *GHub) RemoveLabels(ctx context.Context, 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