Handle maintainer timeout

This commit is contained in:
Zero King
2017-08-15 09:25:52 +00:00
parent 471987b446
commit dd73a99f18
10 changed files with 308 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import (
)
type Client interface {
GetPullRequest(owner, repo string, number int) (*github.PullRequest, error)
ListChangedPortsAndFiles(owner, repo string, number int) (ports []string, commitFiles []*github.CommitFile, err error)
CreateComment(owner, repo string, number int, body *string) error
ReplaceLabels(owner, repo string, number int, labels []string) error

View File

@@ -7,6 +7,11 @@ import (
"github.com/google/go-github/github"
)
func (client *githubClient) GetPullRequest(owner, repo string, number int) (*github.PullRequest, error) {
pr, _, err := client.PullRequests.Get(context.Background(), owner, repo, number)
return pr, err
}
func (client *githubClient) ListChangedPortsAndFiles(owner, repo string, number int) (ports []string, commitFiles []*github.CommitFile, err error) {
var allFiles []*github.CommitFile
opt := &github.ListOptions{PerPage: 30}