Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 26ca2ef893 | |||
| 4fb25871a6 | |||
| 22a6a67d07 | |||
| d7570ff094 | |||
| 2dbe987740 | |||
| b3a5a8edf7 | |||
| dfc330f6eb | |||
| cdc59eb3ef | |||
| a39ebc145a | |||
| 24279ccb4b | |||
| 4708dcb9f1 | |||
| 3fda9e72e1 | |||
| a610eb250e | |||
| f583341fb8 |
+2
-2
@@ -1,6 +1,6 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.10.3
|
||||
- 1.11.2
|
||||
- tip
|
||||
matrix:
|
||||
allow_failures:
|
||||
@@ -29,6 +29,6 @@ script:
|
||||
- make test
|
||||
|
||||
after_success: |
|
||||
[ $TRAVIS_GO_VERSION = 1.10.3 ] &&
|
||||
[ $TRAVIS_GO_VERSION = 1.11.2 ] &&
|
||||
overalls -project="github.com/go-playground/webhooks" -covermode=count -ignore=.git,_examples,testdata -debug &&
|
||||
goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Library webhooks
|
||||
================
|
||||
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v5/logo.png">
|
||||
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v5/logo.png">
|
||||
[](https://travis-ci.org/go-playground/webhooks)
|
||||
[](https://coveralls.io/github/go-playground/webhooks?branch=v5)
|
||||
[](https://goreportcard.com/report/go-playground/webhooks)
|
||||
|
||||
@@ -93,7 +93,7 @@ func (hook Webhook) Parse(r *http.Request, events ...Event) (interface{}, error)
|
||||
}
|
||||
|
||||
uuid := r.Header.Get("X-Hook-UUID")
|
||||
if uuid == "" {
|
||||
if hook.uuid != "" && uuid == "" {
|
||||
return nil, ErrMissingHookUUIDHeader
|
||||
}
|
||||
|
||||
|
||||
+50
-44
@@ -1109,15 +1109,16 @@ type IssueCommentPayload struct {
|
||||
Name string `json:"name"`
|
||||
Color string `json:"color"`
|
||||
} `json:"labels"`
|
||||
State string `json:"state"`
|
||||
Locked bool `json:"locked"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
Comments int64 `json:"comments"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
Body string `json:"body"`
|
||||
State string `json:"state"`
|
||||
Locked bool `json:"locked"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Assignees []*Assignee `json:"assignees"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
Comments int64 `json:"comments"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
Body string `json:"body"`
|
||||
} `json:"issue"`
|
||||
Comment struct {
|
||||
URL string `json:"url"`
|
||||
@@ -1294,15 +1295,16 @@ type IssuesPayload struct {
|
||||
Color string `json:"color"`
|
||||
Default bool `json:"default"`
|
||||
} `json:"labels"`
|
||||
State string `json:"state"`
|
||||
Locked bool `json:"locked"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
Comments int64 `json:"comments"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
Body string `json:"body"`
|
||||
State string `json:"state"`
|
||||
Locked bool `json:"locked"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Assignees []*Assignee `json:"assignees"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
Comments int64 `json:"comments"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
Body string `json:"body"`
|
||||
} `json:"issue"`
|
||||
Repository struct {
|
||||
ID int64 `json:"id"`
|
||||
@@ -1410,6 +1412,7 @@ type IssuesPayload struct {
|
||||
Type string `json:"type"`
|
||||
SiteAdmin bool `json:"site_admin"`
|
||||
} `json:"sender"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
}
|
||||
|
||||
// LabelPayload contains the information for GitHub's label hook event
|
||||
@@ -2757,19 +2760,20 @@ type PullRequestPayload struct {
|
||||
Type string `json:"type"`
|
||||
SiteAdmin bool `json:"site_admin"`
|
||||
} `json:"user"`
|
||||
Body string `json:"body"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
MergedAt *time.Time `json:"merged_at"`
|
||||
MergeCommitSha *string `json:"merge_commit_sha"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
CommitsURL string `json:"commits_url"`
|
||||
ReviewCommentsURL string `json:"review_comments_url"`
|
||||
ReviewCommentURL string `json:"review_comment_url"`
|
||||
CommentsURL string `json:"comments_url"`
|
||||
StatusesURL string `json:"statuses_url"`
|
||||
Body string `json:"body"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
MergedAt *time.Time `json:"merged_at"`
|
||||
MergeCommitSha *string `json:"merge_commit_sha"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Assignees []*Assignee `json:"assignees"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
CommitsURL string `json:"commits_url"`
|
||||
ReviewCommentsURL string `json:"review_comments_url"`
|
||||
ReviewCommentURL string `json:"review_comment_url"`
|
||||
CommentsURL string `json:"comments_url"`
|
||||
StatusesURL string `json:"statuses_url"`
|
||||
RequestedReviewers []struct {
|
||||
Login string `json:"login"`
|
||||
ID int `json:"id"`
|
||||
@@ -3168,6 +3172,7 @@ type PullRequestPayload struct {
|
||||
Type string `json:"type"`
|
||||
SiteAdmin bool `json:"site_admin"`
|
||||
} `json:"sender"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Installation struct {
|
||||
ID int64 `json:"id"`
|
||||
} `json:"installation"`
|
||||
@@ -3694,19 +3699,20 @@ type PullRequestReviewCommentPayload struct {
|
||||
Type string `json:"type"`
|
||||
SiteAdmin bool `json:"site_admin"`
|
||||
} `json:"user"`
|
||||
Body string `json:"body"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
MergedAt *time.Time `json:"merged_at"`
|
||||
MergeCommitSha string `json:"merge_commit_sha"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
CommitsURL string `json:"commits_url"`
|
||||
ReviewCommentsURL string `json:"review_comments_url"`
|
||||
ReviewCommentURL string `json:"review_comment_url"`
|
||||
CommentsURL string `json:"comments_url"`
|
||||
StatusesURL string `json:"statuses_url"`
|
||||
Body string `json:"body"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ClosedAt *time.Time `json:"closed_at"`
|
||||
MergedAt *time.Time `json:"merged_at"`
|
||||
MergeCommitSha string `json:"merge_commit_sha"`
|
||||
Assignee *Assignee `json:"assignee"`
|
||||
Assignees []*Assignee `json:"assignees"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
CommitsURL string `json:"commits_url"`
|
||||
ReviewCommentsURL string `json:"review_comments_url"`
|
||||
ReviewCommentURL string `json:"review_comment_url"`
|
||||
CommentsURL string `json:"comments_url"`
|
||||
StatusesURL string `json:"statuses_url"`
|
||||
Head struct {
|
||||
Label string `json:"label"`
|
||||
Ref string `json:"ref"`
|
||||
|
||||
+9
-1
@@ -177,10 +177,18 @@ type Build struct {
|
||||
When string `json:"when"`
|
||||
Manual bool `json:"manual"`
|
||||
User User `json:"user"`
|
||||
Runner string `json:"runner"`
|
||||
Runner Runner `json:"runner"`
|
||||
ArtifactsFile ArtifactsFile `json:"artifactsfile"`
|
||||
}
|
||||
|
||||
// Runner represents a runner agent
|
||||
type Runner struct {
|
||||
ID int64 `json:"id"`
|
||||
Description string `json:"description"`
|
||||
Active bool `json:"active"`
|
||||
IsShared bool `json:"is_shared"`
|
||||
}
|
||||
|
||||
// ArtifactsFile contains all of the GitLab artifact information
|
||||
type ArtifactsFile struct {
|
||||
Filename string `json:"filename"`
|
||||
|
||||
Reference in New Issue
Block a user