Documentation ¶
Index ¶
- Constants
- Variables
- func HasLabel(label string, issueLabels []Label) bool
- func PayloadSignature(payload []byte, key []byte) string
- func ValidatePayload(payload []byte, sig string, key []byte) bool
- type Branch
- type BranchProtectionRequest
- type Client
- func (c *Client) AddLabel(org, repo string, number int, label string) error
- func (c *Client) AddRepoLabel(org, repo, label, color string) error
- func (c *Client) AssignIssue(org, repo string, number int, logins []string) error
- func (c *Client) BotName() (string, error)
- func (c *Client) ClearMilestone(org, repo string, num int) error
- func (c *Client) CloseIssue(org, repo string, number int) error
- func (c *Client) ClosePR(org, repo string, number int) error
- func (c *Client) CreateComment(org, repo string, number int, comment string) error
- func (c *Client) CreateCommentReaction(org, repo string, ID int, reaction string) error
- func (c *Client) CreateFork(owner, repo string) error
- func (c *Client) CreateIssueReaction(org, repo string, ID int, reaction string) error
- func (c *Client) CreatePullRequest(org, repo, title, body, head, base string, canModify bool) (int, error)
- func (c *Client) CreateReview(org, repo string, number int, r DraftReview) error
- func (c *Client) CreateStatus(org, repo, sha string, s Status) error
- func (c *Client) DeleteComment(org, repo string, ID int) error
- func (c *Client) DeleteRepoLabel(org, repo, label string) error
- func (c *Client) DeleteStaleComments(org, repo string, number int, comments []IssueComment, ...) error
- func (c *Client) EditComment(org, repo string, ID int, comment string) error
- func (c *Client) Email() (string, error)
- func (c *Client) FindIssues(query, sort string, asc bool) ([]Issue, error)
- func (c *Client) GetBranches(org, repo string) ([]Branch, error)
- func (c *Client) GetCombinedStatus(org, repo, ref string) (*CombinedStatus, error)
- func (c *Client) GetFile(org, repo, filepath, commit string) ([]byte, error)
- func (c *Client) GetIssueLabels(org, repo string, number int) ([]Label, error)
- func (c *Client) GetPullRequest(org, repo string, number int) (*PullRequest, error)
- func (c *Client) GetPullRequestChanges(org, repo string, number int) ([]PullRequestChange, error)
- func (c *Client) GetPullRequestPatch(org, repo string, number int) ([]byte, error)
- func (c *Client) GetRef(org, repo, ref string) (string, error)
- func (c *Client) GetRepo(owner, name string) (Repo, error)
- func (c *Client) GetRepoLabels(org, repo string) ([]Label, error)
- func (c *Client) GetRepos(org string, isUser bool) ([]Repo, error)
- func (c *Client) IsMember(org, user string) (bool, error)
- func (c *Client) IsMergeable(org, repo string, number int, sha string) (bool, error)
- func (c *Client) ListCollaborators(org, repo string) ([]User, error)
- func (c *Client) ListIssueComments(org, repo string, number int) ([]IssueComment, error)
- func (c *Client) ListIssueEvents(org, repo string, num int) ([]ListedIssueEvent, error)
- func (c *Client) ListMilestones(org, repo string) ([]Milestone, error)
- func (c *Client) ListOrgMembers(org string) ([]TeamMember, error)
- func (c *Client) ListPullRequestComments(org, repo string, number int) ([]ReviewComment, error)
- func (c *Client) ListReviews(org, repo string, number int) ([]Review, error)
- func (c *Client) ListStatuses(org, repo, ref string) ([]Status, error)
- func (c *Client) ListTeamMembers(id int) ([]TeamMember, error)
- func (c *Client) ListTeams(org string) ([]Team, error)
- func (c *Client) Merge(org, repo string, pr int, details MergeDetails) error
- func (c *Client) Query(ctx context.Context, q interface{}, vars map[string]interface{}) error
- func (c *Client) RemoveBranchProtection(org, repo, branch string) error
- func (c *Client) RemoveLabel(org, repo string, number int, label string) error
- func (c *Client) ReopenIssue(org, repo string, number int) error
- func (c *Client) ReopenPR(org, repo string, number int) error
- func (c *Client) RequestReview(org, repo string, number int, logins []string) error
- func (c *Client) SetMilestone(org, repo string, issueNum, milestoneNum int) error
- func (c *Client) Throttle(hourlyTokens, burst int)
- func (c *Client) UnassignIssue(org, repo string, number int, logins []string) error
- func (c *Client) UnrequestReview(org, repo string, number int, logins []string) error
- func (c *Client) UpdateBranchProtection(org, repo, branch string, config BranchProtectionRequest) error
- func (c *Client) UpdateRepoLabel(org, repo, label, name, color string) error
- type ClientError
- type CombinedStatus
- type Commit
- type Content
- type DraftReview
- type DraftReviewComment
- type ExtraUsers
- type FileNotFound
- type GenericCommentEvent
- type GenericCommentEventAction
- type Issue
- type IssueComment
- type IssueCommentEvent
- type IssueCommentEventAction
- type IssueEvent
- type IssueEventAction
- type IssuesSearchResult
- type Label
- type LabelNotFound
- type ListedIssueEvent
- type MergeDetails
- type Milestone
- type MissingUsers
- type ModifiedHeadError
- type PullRequest
- type PullRequestBranch
- type PullRequestChange
- type PullRequestEvent
- type PullRequestEventAction
- type PullRequestFileStatus
- type PullRequestMergeType
- type PushEvent
- type Reaction
- type Repo
- type RequiredPullRequestReviews
- type RequiredStatusChecks
- type Restrictions
- type Review
- type ReviewAction
- type ReviewComment
- type ReviewCommentEvent
- type ReviewCommentEventAction
- type ReviewEvent
- type ReviewEventAction
- type StateCannotBeChanged
- type Status
- type StatusEvent
- type Team
- type TeamMember
- type UnauthorizedToPushError
- type UnmergablePRBaseChangedError
- type UnmergablePRError
- type User
Constants ¶
const ( // EventGUID is sent by Github in a header of every webhook request. // Used as a log field across prow. EventGUID = "event-GUID" // PrLogField is the number of a PR. // Used as a log field across prow. PrLogField = "pr" // OrgLogField is the organization of a PR. // Used as a log field across prow. OrgLogField = "org" // RepoLogField is the repository of a PR. // Used as a log field across prow. RepoLogField = "repo" )
const ( StatusPending = "pending" StatusSuccess = "success" StatusError = "error" StatusFailure = "failure" )
These are possible State entries for a Status.
const ( ReactionThumbsUp = "+1" ReactionThumbsDown = "-1" ReactionLaugh = "laugh" ReactionConfused = "confused" ReactionHeart = "heart" ReactionHooray = "hooray" )
Possible contents for reactions.
const ( PullRequestActionAssigned PullRequestEventAction = "assigned" PullRequestActionUnassigned = "unassigned" PullRequestActionReviewRequested = "review_requested" PullRequestActionReviewRequestRemoved = "review_request_removed" PullRequestActionLabeled = "labeled" PullRequestActionUnlabeled = "unlabeled" PullRequestActionOpened = "opened" PullRequestActionEdited = "edited" PullRequestActionClosed = "closed" PullRequestActionReopened = "reopened" PullRequestActionSynchronize = "synchronize" )
const ( PullRequestFileModified PullRequestFileStatus = "modified" PullRequestFileAdded = "added" PullRequestFileRemoved = "removed" PullRequestFileRenamed = "renamed" )
const ( IssueActionAssigned IssueEventAction = "assigned" IssueActionUnassigned = "unassigned" IssueActionLabeled = "labeled" IssueActionUnlabeled = "unlabeled" IssueActionOpened = "opened" IssueActionEdited = "edited" IssueActionMilestoned = "milestoned" IssueActionDemilestoned = "demilestoned" IssueActionClosed = "closed" IssueActionReopened = "reopened" )
const ( IssueCommentActionCreated IssueCommentEventAction = "created" IssueCommentActionEdited = "edited" IssueCommentActionDeleted = "deleted" )
const ( ReviewActionSubmitted ReviewEventAction = "submitted" ReviewActionEdited = "edited" ReviewActionDismissed = "dismissed" )
const ( ReviewCommentActionCreated ReviewCommentEventAction = "created" ReviewCommentActionEdited = "edited" ReviewCommentActionDeleted = "deleted" )
const ( Approve ReviewAction = "APPROVE" RequestChanges = "REQUEST_CHANGES" Comment = "COMMENT" )
Possible review actions. Leave Action blank for a pending review.
const ( GenericCommentActionCreated GenericCommentEventAction = "created" // "opened", "submitted" GenericCommentActionEdited = "edited" GenericCommentActionDeleted = "deleted" // "dismissed" )
Comments indicate values that are coerced to the specified value.
Variables ¶
var NormLogin = strings.ToLower
NormLogin normalizes GitHub login strings
Functions ¶
func PayloadSignature ¶
PayloadSignature returns the signature that matches the payload.
Types ¶
type BranchProtectionRequest ¶
type BranchProtectionRequest struct { RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"` EnforceAdmins *bool `json:"enforce_admins"` RequiredPullRequestReviews *RequiredPullRequestReviews `json:"required_pull_request_reviews"` Restrictions *Restrictions `json:"restrictions"` }
BranchProtectionRequest represents protections in place for a branch. See also: https://developer.github.com/v3/repos/branches/#update-branch-protection
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewDryRunClient ¶
NewDryRunClient creates a new client that will not perform mutating actions such as setting statuses or commenting, but it will still query GitHub and use up API tokens.
func NewFakeClient ¶
func NewFakeClient() *Client
NewFakeClient creates a new client that will not perform any actions at all.
func (*Client) AddRepoLabel ¶
Adds Label label/color to given org/repo
func (*Client) AssignIssue ¶
func (*Client) ClearMilestone ¶
ClearMilestone clears the milestone from the specified issue
func (*Client) CloseIssue ¶
CloseIssue closes the existing, open issue provided
func (*Client) ClosePR ¶
ClosePR closes the existing, open PR provided TODO: Rename to ClosePullRequest
func (*Client) CreateComment ¶
CreateComment creates a comment on the issue.
func (*Client) CreateCommentReaction ¶
func (*Client) CreateFork ¶
CreateFork creates a fork for the authenticated user. Forking a repository happens asynchronously. Therefore, we may have to wait a short period before accessing the git objects. If this takes longer than 5 minutes, Github recommends contacting their support.
See https://developer.github.com/v3/repos/forks/#create-a-fork
func (*Client) CreateIssueReaction ¶
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(org, repo, title, body, head, base string, canModify bool) (int, error)
CreatePullRequest creates a new pull request and returns its number if the creation is successful, otherwise any error that is encountered.
func (*Client) CreateReview ¶
func (c *Client) CreateReview(org, repo string, number int, r DraftReview) error
CreateReview creates a review using the draft.
func (*Client) CreateStatus ¶
CreateStatus creates or updates the status of a commit.
func (*Client) DeleteComment ¶
DeleteComment deletes the comment.
func (*Client) DeleteRepoLabel ¶
Delete label in org/repo
func (*Client) DeleteStaleComments ¶
func (c *Client) DeleteStaleComments(org, repo string, number int, comments []IssueComment, isStale func(IssueComment) bool) error
DeleteStaleComments iterates over comments on an issue/PR, deleting those which the 'isStale' function identifies as stale. If 'comments' is nil, the comments will be fetched from github.
func (*Client) EditComment ¶
func (*Client) FindIssues ¶
FindIssues uses the github search API to find issues which match a particular query.
Input query the same way you would into the website. Order returned results with sort (usually "updated"). Control whether oldest/newest is first with asc.
See https://help.github.com/articles/searching-issues-and-pull-requests/ for details.
func (*Client) GetCombinedStatus ¶
func (c *Client) GetCombinedStatus(org, repo, ref string) (*CombinedStatus, error)
GetCombinedStatus returns the latest statuses for a given ref.
func (*Client) GetFile ¶
GetFile uses github repo contents API to retrieve the content of a file with commit sha. If commit is empty, it will grab content from repo's default branch, usually master. TODO(krzyzacy): Support retrieve a directory
func (*Client) GetIssueLabels ¶
func (*Client) GetPullRequest ¶
func (c *Client) GetPullRequest(org, repo string, number int) (*PullRequest, error)
GetPullRequest gets a pull request.
func (*Client) GetPullRequestChanges ¶
func (c *Client) GetPullRequestChanges(org, repo string, number int) ([]PullRequestChange, error)
GetPullRequestChanges gets a list of files modified in a pull request.
func (*Client) GetPullRequestPatch ¶
GetPullRequestPatch gets the patch version of a pull request.
func (*Client) IsMergeable ¶
IsMergeable determines if a PR can be merged. Mergeability is calculated by a background job on github and is not immediately available when new commits are added so the PR must be polled until the background job completes.
func (*Client) ListCollaborators ¶
ListCollaborators gets a list of all users who have access to a repo (and can become assignees or requested reviewers). This includes, org members with access, outside collaborators, and org owners.
func (*Client) ListIssueComments ¶
func (c *Client) ListIssueComments(org, repo string, number int) ([]IssueComment, error)
ListIssueComments returns all comments on an issue. This may use more than one API token.
func (*Client) ListIssueEvents ¶
func (c *Client) ListIssueEvents(org, repo string, num int) ([]ListedIssueEvent, error)
ListIssueEvents gets a list events from github's events API that pertain to the specified issue. The events that are returned have a different format than webhook events and certain event types are excluded. https://developer.github.com/v3/issues/events/
func (*Client) ListMilestones ¶
ListMilestones list all milestones in a repo https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository/
func (*Client) ListOrgMembers ¶
func (c *Client) ListOrgMembers(org string) ([]TeamMember, error)
ListOrgMembers list all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
func (*Client) ListPullRequestComments ¶
func (c *Client) ListPullRequestComments(org, repo string, number int) ([]ReviewComment, error)
ListPullRequestComments returns all *review* comments on a pull request. This may use more than one API token.
func (*Client) ListReviews ¶
ListReviews returns all reviews on a pull request. This may use more than one API token.
func (*Client) ListStatuses ¶
ListStatuses gets commit statuses for a given ref.
func (*Client) ListTeamMembers ¶
func (c *Client) ListTeamMembers(id int) ([]TeamMember, error)
ListTeamMembers gets a list of team members for the given team id
func (*Client) Merge ¶
func (c *Client) Merge(org, repo string, pr int, details MergeDetails) error
Merge merges a PR.
func (*Client) RemoveBranchProtection ¶
func (*Client) RemoveLabel ¶
func (*Client) ReopenIssue ¶
ReopenIssue re-opens the existing, closed issue provided
func (*Client) ReopenPR ¶
ReopenPR re-opens the existing, closed PR provided TODO: Rename to ReopenPullRequest
func (*Client) RequestReview ¶
RequestReview tries to add the users listed in 'logins' as requested reviewers of the specified PR. If any user in the 'logins' slice is not a contributor of the repo, the entire POST will fail without adding any reviewers. The github API response does not specify which user(s) were invalid so if we fail to request reviews from the members of 'logins' we try to request reviews from each member individually. We try first with all users in 'logins' for efficiency in the common case.
func (*Client) SetMilestone ¶
SetMilestone sets the milestone from the specified issue (if it is a valid milestone)
func (*Client) Throttle ¶
Throttle client to a rate of at most hourlyTokens requests per hour, allowing burst tokens.
func (*Client) UnassignIssue ¶
func (*Client) UnrequestReview ¶
UnrequestReview tries to remove the users listed in 'logins' from the requested reviewers of the specified PR. The github API treats deletions of review requests differently than creations. Specifically, if 'logins' contains a user that isn't a requested reviewer, other users that are valid are still removed. Furthermore, the API response lists the set of requested reviewers after the deletion (unlike request creations), so we can determine if each deletion was successful. The API responds with http status code 200 no matter what the content of 'logins' is.
func (*Client) UpdateBranchProtection ¶
func (c *Client) UpdateBranchProtection(org, repo, branch string, config BranchProtectionRequest) error
func (*Client) UpdateRepoLabel ¶
Updates org/repo label to new name and color
type ClientError ¶
type ClientError struct { Message string `json:"message"` Errors []struct { Resource string `json:"resource"` Field string `json:"field"` Code string `json:"code"` Message string `json:"message,omitempty"` } `json:"errors,omitempty"` }
ClientError represents https://developer.github.com/v3/#client-errors
type CombinedStatus ¶
type CombinedStatus struct {
Statuses []Status `json:"statuses"`
}
CombinedStatus is the latest statuses for a ref.
type Commit ¶
type Commit struct { ID string `json:"id"` Message string `json:"message"` Added []string `json:"added"` Removed []string `json:"removed"` Modified []string `json:"modified"` }
Commit represents general info about a commit.
type DraftReview ¶
type DraftReview struct { // If unspecified, defaults to the most recent commit in the PR. CommitSHA string `json:"commit_id,omitempty"` Body string `json:"body"` // If unspecified, defaults to PENDING. Action ReviewAction `json:"event,omitempty"` Comments []DraftReviewComment `json:"comments,omitempty"` }
DraftReview is what we give GitHub when we want to make a PR Review. This is different than what we receive when we ask for a Review.
type DraftReviewComment ¶
type DraftReviewComment struct { Path string `json:"path"` // Position in the patch, not the line number in the file. Position int `json:"position"` Body string `json:"body"` }
DraftReviewComment is a comment in a draft review.
type ExtraUsers ¶
type ExtraUsers struct { Users []string // contains filtered or unexported fields }
func (ExtraUsers) Error ¶
func (e ExtraUsers) Error() string
type FileNotFound ¶
type FileNotFound struct {
// contains filtered or unexported fields
}
func (*FileNotFound) Error ¶
func (e *FileNotFound) Error() string
type GenericCommentEvent ¶
type GenericCommentEvent struct { IsPR bool Action GenericCommentEventAction Body string HTMLURL string Number int Repo Repo User User IssueAuthor User Assignees []User IssueState string IssueBody string IssueHTMLURL string }
GenericCommentEvent is a fake event type that is instantiated for any github event that contains comment like content. The specific events that are also handled as GenericCommentEvents are: - issue_comment events - pull_request_review events - pull_request_review_comment events - pull_request events with action in ["opened", "edited"] - issue events with action in ["opened", "edited"]
Issue and PR "closed" events are not coerced to the "deleted" Action and do not trigger a GenericCommentEvent because these events don't actually remove the comment content from GH.
type GenericCommentEventAction ¶
type GenericCommentEventAction string
type Issue ¶
type Issue struct { User User `json:"user"` Number int `json:"number"` Title string `json:"title"` State string `json:"state"` HTMLURL string `json:"html_url"` Labels []Label `json:"labels"` Assignees []User `json:"assignees"` Body string `json:"body"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Milestone Milestone `json:"milestone"` // This will be non-nil if it is a pull request. PullRequest *struct{} `json:"pull_request,omitempty"` }
Issue represents general info about an issue.
func (Issue) IsAssignee ¶
IsAssignee checks if a user is assigned to the issue.
func (Issue) IsPullRequest ¶
IsPullRequest checks if an issue is a pull request.
type IssueComment ¶
type IssueComment struct { ID int `json:"id,omitempty"` Body string `json:"body"` User User `json:"user,omitempty"` HTMLURL string `json:"html_url,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
IssueComment represents general info about an issue comment.
type IssueCommentEvent ¶
type IssueCommentEvent struct { Action IssueCommentEventAction `json:"action"` Issue Issue `json:"issue"` Comment IssueComment `json:"comment"` Repo Repo `json:"repository"` // GUID is included in the header of the request received by Github. GUID string }
IssueCommentEvent is what GitHub sends us when an issue comment is changed.
type IssueCommentEventAction ¶
type IssueCommentEventAction string
IssueCommentEventAction enumerates the triggers for this webhook payload type. See also: https://developer.github.com/v3/activity/events/types/#issuecommentevent
type IssueEvent ¶
type IssueEvent struct { Action IssueEventAction `json:"action"` Issue Issue `json:"issue"` Repo Repo `json:"repository"` // Label is specified for IssueActionLabeled and IssueActionUnlabeled events. Label Label `json:"label"` // GUID is included in the header of the request received by Github. GUID string }
IssueEvent represents an issue event from a webhook payload (not from the events API).
type IssueEventAction ¶
type IssueEventAction string
IssueEventAction enumerates the triggers for this webhook payload type. See also: https://developer.github.com/v3/activity/events/types/#issuesevent
type IssuesSearchResult ¶
type IssuesSearchResult struct { Total int `json:"total_count,omitempty"` Issues []Issue `json:"items,omitempty"` }
IssuesSearchResult represents the result of an issues search.
type LabelNotFound ¶
LabelNotFound indicates that a label is not attached to an issue. For example, removing a label from an issue, when the issue does not have that label.
func (*LabelNotFound) Error ¶
func (e *LabelNotFound) Error() string
type ListedIssueEvent ¶
type ListedIssueEvent struct { Event IssueEventAction `json:"event"` // This is the same as IssueEvent.Action. Actor User `json:"actor"` Label Label `json:"label"` CreatedAt time.Time `json:"created_at"` }
ListedIssueEvent represents an issue event from the events API (not from a webhook payload). https://developer.github.com/v3/issues/events/
type MergeDetails ¶
type MergeDetails struct { // CommitTitle defaults to the automatic message. CommitTitle string `json:"commit_title,omitempty"` // CommitMessage defaults to the automatic message. CommitMessage string `json:"commit_message,omitempty"` // The PR HEAD must match this to prevent races. SHA string `json:"sha,omitempty"` // Can be "merge", "squash", or "rebase". Defaults to merge. MergeMethod string `json:"merge_method,omitempty"` }
MergeDetails contains desired properties of the merge. See https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
type MissingUsers ¶
type MissingUsers struct { Users []string // contains filtered or unexported fields }
func (MissingUsers) Error ¶
func (m MissingUsers) Error() string
type ModifiedHeadError ¶
type ModifiedHeadError string
func (ModifiedHeadError) Error ¶
func (e ModifiedHeadError) Error() string
type PullRequest ¶
type PullRequest struct { Number int `json:"number"` HTMLURL string `json:"html_url"` User User `json:"user"` Base PullRequestBranch `json:"base"` Head PullRequestBranch `json:"head"` Title string `json:"title"` Body string `json:"body"` RequestedReviewers []User `json:"requested_reviewers"` Assignees []User `json:"assignees"` State string `json:"state"` Merged bool `json:"merged"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` // ref https://developer.github.com/v3/pulls/#get-a-single-pull-request // If Merged is true, MergeSHA is the SHA of the merge commit, or squashed commit // If Merged is false, MergeSHA is a commit SHA that github created to test if // the PR can be merged automatically. MergeSHA *string `json:"merge_commit_sha"` // ref https://developer.github.com/v3/pulls/#response-1 // The value of the mergeable attribute can be true, false, or null. If the value // is null, this means that the mergeability hasn't been computed yet, and a // background job was started to compute it. When the job is complete, the response // will include a non-null value for the mergeable attribute. Mergable *bool `json:"mergeable,omitempty"` }
PullRequest contains information about a PullRequest.
type PullRequestBranch ¶
type PullRequestBranch struct { Ref string `json:"ref"` SHA string `json:"sha"` Repo Repo `json:"repo"` }
PullRequestBranch contains information about a particular branch in a PR.
type PullRequestChange ¶
type PullRequestChange struct { SHA string `json:"sha"` Filename string `json:"filename"` Status string `json:"status"` Additions int `json:"additions"` Deletions int `json:"deletions"` Changes int `json:"changes"` Patch string `json:"patch"` BlobURL string `json:"blob_url"` }
PullRequestChange contains information about what a PR changed.
type PullRequestEvent ¶
type PullRequestEvent struct { Action PullRequestEventAction `json:"action"` Number int `json:"number"` PullRequest PullRequest `json:"pull_request"` Repo Repo `json:"repository"` Label Label `json:"label"` Sender User `json:"sender"` // GUID is included in the header of the request received by Github. GUID string }
PullRequestEvent is what GitHub sends us when a PR is changed.
type PullRequestEventAction ¶
type PullRequestEventAction string
PullRequestEventAction enumerates the triggers for this webhook payload type. See also: https://developer.github.com/v3/activity/events/types/#pullrequestevent
type PullRequestFileStatus ¶
type PullRequestFileStatus string
PullRequestFileStatus enumerates the statuses for this webhook payload type.
type PullRequestMergeType ¶
type PullRequestMergeType string
PullRequestMergeType enumerates the types of merges the GitHub API can perform https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
const ( MergeMerge PullRequestMergeType = "merge" MergeRebase PullRequestMergeType = "rebase" MergeSquash PullRequestMergeType = "squash" )
Possible types of merges for the GitHub merge API
type PushEvent ¶
type PushEvent struct { Ref string `json:"ref"` Before string `json:"before"` After string `json:"after"` Compare string `json:"compare"` Commits []Commit `json:"commits"` // Pusher is the user that pushed the commit, valid in a webhook event. Pusher User `json:"pusher"` // Sender contains more information that Pusher about the user. Sender User `json:"sender"` Repo Repo `json:"repository"` // GUID is included in the header of the request received by Github. GUID string }
PushEvent is what GitHub sends us when a user pushes to a repo.
type Repo ¶
type Repo struct { Owner User `json:"owner"` Name string `json:"name"` FullName string `json:"full_name"` HTMLURL string `json:"html_url"` Fork bool `json:"fork"` DefaultBranch string `json:"default_branch"` }
Repo contains general repository information.
type RequiredPullRequestReviews ¶
type RequiredPullRequestReviews struct{}
type RequiredStatusChecks ¶
type Restrictions ¶
type Review ¶
type Review struct { ID int `json:"id"` User User `json:"user"` Body string `json:"body"` State string `json:"state"` HTMLURL string `json:"html_url"` SubmittedAt time.Time `json:"submitted_at"` }
Review describes a Pull Request review.
type ReviewAction ¶
type ReviewAction string
ReviewAction is the action that a review can be made with.
type ReviewComment ¶
type ReviewComment struct { ID int `json:"id"` ReviewID int `json:"pull_request_review_id"` User User `json:"user"` Body string `json:"body"` Path string `json:"path"` HTMLURL string `json:"html_url"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` // Position will be nil if the code has changed such that the comment is no // longer relevant. Position *int `json:"position"` }
ReviewComment describes a Pull Request review.
type ReviewCommentEvent ¶
type ReviewCommentEvent struct { Action ReviewCommentEventAction `json:"action"` PullRequest PullRequest `json:"pull_request"` Repo Repo `json:"repository"` Comment ReviewComment `json:"comment"` // GUID is included in the header of the request received by Github. GUID string }
ReviewCommentEvent is what GitHub sends us when a PR review comment is changed.
type ReviewCommentEventAction ¶
type ReviewCommentEventAction string
ReviewCommentEventAction enumerates the triggers for this webhook payload type. See also: https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent
type ReviewEvent ¶
type ReviewEvent struct { Action ReviewEventAction `json:"action"` PullRequest PullRequest `json:"pull_request"` Repo Repo `json:"repository"` Review Review `json:"review"` // GUID is included in the header of the request received by Github. GUID string }
ReviewEvent is what GitHub sends us when a PR review is changed.
type ReviewEventAction ¶
type ReviewEventAction string
ReviewEventAction enumerates the triggers for this webhook payload type. See also: https://developer.github.com/v3/activity/events/types/#pullrequestreviewevent
type StateCannotBeChanged ¶
type StateCannotBeChanged struct {
Message string
}
StateCannotBeChanged represents the "custom" GitHub API error that occurs when a resource cannot be changed
func (StateCannotBeChanged) Error ¶
func (s StateCannotBeChanged) Error() string
type Status ¶
type Status struct { State string `json:"state"` TargetURL string `json:"target_url,omitempty"` Description string `json:"description,omitempty"` Context string `json:"context,omitempty"` }
Status is used to set a commit status line.
type StatusEvent ¶
type StatusEvent struct { SHA string `json:"sha,omitempty"` State string `json:"state,omitempty"` Description string `json:"description,omitempty"` TargetURL string `json:"target_url,omitempty"` ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Context string `json:"context,omitempty"` Sender User `json:"sender,omitempty"` Repo Repo `json:"repository,omitempty"` // GUID is included in the header of the request received by Github. GUID string }
type TeamMember ¶
type TeamMember struct {
Login string `json:"login"`
}
TeamMember is a member of an organizational team
type UnauthorizedToPushError ¶
type UnauthorizedToPushError string
func (UnauthorizedToPushError) Error ¶
func (e UnauthorizedToPushError) Error() string
type UnmergablePRBaseChangedError ¶
type UnmergablePRBaseChangedError string
func (UnmergablePRBaseChangedError) Error ¶
func (e UnmergablePRBaseChangedError) Error() string
type UnmergablePRError ¶
type UnmergablePRError string
func (UnmergablePRError) Error ¶
func (e UnmergablePRError) Error() string