-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
github.go
57 lines (54 loc) · 1.32 KB
/
github.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package webhook
import (
"net/http"
"gopkg.in/go-playground/webhooks.v5/github"
)
func githubMatch(secret string, r *http.Request) bool {
hook, err := github.New(github.Options.Secret(secret))
if err != nil {
return false
}
_, err = hook.Parse(r,
github.CheckRunEvent,
github.CheckSuiteEvent,
github.CommitCommentEvent,
github.CreateEvent,
github.DeleteEvent,
github.DeploymentEvent,
github.DeploymentStatusEvent,
github.ForkEvent,
github.GollumEvent,
github.InstallationEvent,
github.InstallationRepositoriesEvent,
github.IntegrationInstallationEvent,
github.IntegrationInstallationRepositoriesEvent,
github.IssueCommentEvent,
github.IssuesEvent,
github.LabelEvent,
github.MemberEvent,
github.MembershipEvent,
github.MilestoneEvent,
github.MetaEvent,
github.OrganizationEvent,
github.OrgBlockEvent,
github.PageBuildEvent,
github.PingEvent,
github.ProjectCardEvent,
github.ProjectColumnEvent,
github.ProjectEvent,
github.PublicEvent,
github.PullRequestEvent,
github.PullRequestReviewEvent,
github.PullRequestReviewCommentEvent,
github.PushEvent,
github.ReleaseEvent,
github.RepositoryEvent,
github.RepositoryVulnerabilityAlertEvent,
github.SecurityAdvisoryEvent,
github.StatusEvent,
github.TeamEvent,
github.TeamAddEvent,
github.WatchEvent,
)
return err == nil
}