Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // label LabelReg = regexp.MustCompile("^/[Ll][Aa][Bb][Ee][Ll]") LabelCancelReg = regexp.MustCompile("^/[Rr][Ee][Mm][Oo][Vv][Ee]-[Ll][Aa][Bb][Ee][Ll]") // test OkToTestReg = regexp.MustCompile("^/[Oo][Kk]-[Tt][Oo]-[Tt][Ee][Ss][Tt]") RetestReg = regexp.MustCompile("^/[Rr][Ee][Tt][Ee][Ss][Tt]") TestReg = regexp.MustCompile("^/[Tt][Ee][Ss][Tt]") // review and approve LgtmReg = regexp.MustCompile("^/[Ll][Gg][Tt][Mm]") LgtmCancelReg = regexp.MustCompile("^/[Ll][Gg][Tt][Mm] [Cc][Aa][Nn][Cc][Ee][Ll]") ApproveReg = regexp.MustCompile("^/[Aa][Pp][Pp][Rr][Oo][Vv][Ee]") ApproveCancelReg = regexp.MustCompile("^/[Aa][Pp][Pp][Rr][Oo][Vv][Ee] [Cc][Aa][Nn][Cc][Ee][Ll]") //assign/unassign AssignOrUnassing = regexp.MustCompile("(?mi)^/(un)?assign(( @?[-\\w]+?)*)\\s*$") )
View Source
var ClientRepo *github.Client
Github client
View Source
var IsIssueCommentHandling = false
Syncronization Flag for IssueComment and PR event Handling A Comment in PR section will lead Github to throw 2 webhook events which are 1.The Webhook event name is "issue_comment" 2.The Webhook event name is "pull_request" sequentially. let the handling only be with issue_comment event not pull_request event
Functions ¶
Types ¶
type Config ¶
type Config struct { Repo string `json:"repo"` GitHubToken string `json:"git_hub_token"` WebhookSecret string `json:"webhook_secret"` TravisCIToken string `json:"travis_ci_token"` TravisRepoName string `json:"travis_ci_repoaccount"` }
config structure
type GithubIssue ¶
type GithubPR ¶
type GithubPR github.PullRequestEvent
type Server ¶
type Server struct { Config Config GithubClient *github.Client Repository repository.Interface Context context.Context }
Server implements http.Handler. It validates incoming GitHub webhooks and then dispatches them to the handlers accordingly.
type WebHookServer ¶
webhook server
Click to show internal directories.
Click to hide internal directories.