Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type GitHub
- func (gh *GitHub) GetBotComment(prNum int) (*github.IssueComment, error)
- func (gh *GitHub) GetOpenedPullRequest(prNum int) (*github.PullRequest, error)
- func (gh *GitHub) IsUserInTeams(user string, teams []string) bool
- func (gh *GitHub) ListPR(state string) ([]*github.PullRequest, error)
- func (gh *GitHub) ListPRReviewers(prNum int) (*github.Reviewers, error)
- func (gh *GitHub) ListPRReviews(prNum int) ([]*github.PullRequestReview, error)
- func (gh *GitHub) ListTeamMembers(team string) ([]*github.User, error)
- func (gh *GitHub) SetBotComment(body string, prNum int) (*github.IssueComment, error)
Constants ¶
const PageSize = 100
PageSize is the number of items to load for each iteration when fetching a list.
Variables ¶
var ErrBotCommentNotFound = errors.New("bot comment not found")
Functions ¶
This section is empty.
Types ¶
type GitHub ¶
type GitHub struct { Client *github.Client Ctx context.Context DryRun bool Logger logger.Logger Owner string Repo string }
GitHub contains everything necessary to interact with the GitHub API, including the client, a context (which must be passed with each request), a logger, etc. This object will be passed to each condition or requirement that requires fetching additional information or modifying things on GitHub. The object also provides methods for performing more complex operations than a simple API call.
func (*GitHub) GetBotComment ¶
func (gh *GitHub) GetBotComment(prNum int) (*github.IssueComment, error)
GetBotComment retrieves the bot's (current user) comment on provided PR number.
func (*GitHub) GetOpenedPullRequest ¶
func (gh *GitHub) GetOpenedPullRequest(prNum int) (*github.PullRequest, error)
func (*GitHub) IsUserInTeams ¶
IsUserInTeams checks if the specified user is a member of any of the provided teams.
func (*GitHub) ListPR ¶
func (gh *GitHub) ListPR(state string) ([]*github.PullRequest, error)
ListPR returns the list of pull requests in the specified state.
func (*GitHub) ListPRReviewers ¶
ListPRReviewers returns the list of reviewers for the specified PR number.
func (*GitHub) ListPRReviews ¶
func (gh *GitHub) ListPRReviews(prNum int) ([]*github.PullRequestReview, error)
ListPRReviewers returns the list of reviews for the specified PR number.
func (*GitHub) ListTeamMembers ¶
ListTeamMembers lists the members of the specified team.
func (*GitHub) SetBotComment ¶
SetBotComment creates a bot's comment on the provided PR number or updates it if it already exists.