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
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.10.3
|
- 1.11.2
|
||||||
- tip
|
- tip
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
@@ -29,6 +29,6 @@ script:
|
|||||||
- make test
|
- make test
|
||||||
|
|
||||||
after_success: |
|
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 &&
|
overalls -project="github.com/go-playground/webhooks" -covermode=count -ignore=.git,_examples,testdata -debug &&
|
||||||
goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
|
goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Library webhooks
|
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://travis-ci.org/go-playground/webhooks)
|
||||||
[](https://coveralls.io/github/go-playground/webhooks?branch=v5)
|
[](https://coveralls.io/github/go-playground/webhooks?branch=v5)
|
||||||
[](https://goreportcard.com/report/go-playground/webhooks)
|
[](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")
|
uuid := r.Header.Get("X-Hook-UUID")
|
||||||
if uuid == "" {
|
if hook.uuid != "" && uuid == "" {
|
||||||
return nil, ErrMissingHookUUIDHeader
|
return nil, ErrMissingHookUUIDHeader
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+50
-44
@@ -1109,15 +1109,16 @@ type IssueCommentPayload struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Color string `json:"color"`
|
Color string `json:"color"`
|
||||||
} `json:"labels"`
|
} `json:"labels"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
Locked bool `json:"locked"`
|
Locked bool `json:"locked"`
|
||||||
Assignee *Assignee `json:"assignee"`
|
Assignee *Assignee `json:"assignee"`
|
||||||
Milestone *Milestone `json:"milestone"`
|
Assignees []*Assignee `json:"assignees"`
|
||||||
Comments int64 `json:"comments"`
|
Milestone *Milestone `json:"milestone"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
Comments int64 `json:"comments"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
ClosedAt *time.Time `json:"closed_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
Body string `json:"body"`
|
ClosedAt *time.Time `json:"closed_at"`
|
||||||
|
Body string `json:"body"`
|
||||||
} `json:"issue"`
|
} `json:"issue"`
|
||||||
Comment struct {
|
Comment struct {
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
@@ -1294,15 +1295,16 @@ type IssuesPayload struct {
|
|||||||
Color string `json:"color"`
|
Color string `json:"color"`
|
||||||
Default bool `json:"default"`
|
Default bool `json:"default"`
|
||||||
} `json:"labels"`
|
} `json:"labels"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
Locked bool `json:"locked"`
|
Locked bool `json:"locked"`
|
||||||
Assignee *Assignee `json:"assignee"`
|
Assignee *Assignee `json:"assignee"`
|
||||||
Milestone *Milestone `json:"milestone"`
|
Assignees []*Assignee `json:"assignees"`
|
||||||
Comments int64 `json:"comments"`
|
Milestone *Milestone `json:"milestone"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
Comments int64 `json:"comments"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
ClosedAt *time.Time `json:"closed_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
Body string `json:"body"`
|
ClosedAt *time.Time `json:"closed_at"`
|
||||||
|
Body string `json:"body"`
|
||||||
} `json:"issue"`
|
} `json:"issue"`
|
||||||
Repository struct {
|
Repository struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
@@ -1410,6 +1412,7 @@ type IssuesPayload struct {
|
|||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
SiteAdmin bool `json:"site_admin"`
|
SiteAdmin bool `json:"site_admin"`
|
||||||
} `json:"sender"`
|
} `json:"sender"`
|
||||||
|
Assignee *Assignee `json:"assignee"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LabelPayload contains the information for GitHub's label hook event
|
// LabelPayload contains the information for GitHub's label hook event
|
||||||
@@ -2757,19 +2760,20 @@ type PullRequestPayload struct {
|
|||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
SiteAdmin bool `json:"site_admin"`
|
SiteAdmin bool `json:"site_admin"`
|
||||||
} `json:"user"`
|
} `json:"user"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
ClosedAt *time.Time `json:"closed_at"`
|
ClosedAt *time.Time `json:"closed_at"`
|
||||||
MergedAt *time.Time `json:"merged_at"`
|
MergedAt *time.Time `json:"merged_at"`
|
||||||
MergeCommitSha *string `json:"merge_commit_sha"`
|
MergeCommitSha *string `json:"merge_commit_sha"`
|
||||||
Assignee *Assignee `json:"assignee"`
|
Assignee *Assignee `json:"assignee"`
|
||||||
Milestone *Milestone `json:"milestone"`
|
Assignees []*Assignee `json:"assignees"`
|
||||||
CommitsURL string `json:"commits_url"`
|
Milestone *Milestone `json:"milestone"`
|
||||||
ReviewCommentsURL string `json:"review_comments_url"`
|
CommitsURL string `json:"commits_url"`
|
||||||
ReviewCommentURL string `json:"review_comment_url"`
|
ReviewCommentsURL string `json:"review_comments_url"`
|
||||||
CommentsURL string `json:"comments_url"`
|
ReviewCommentURL string `json:"review_comment_url"`
|
||||||
StatusesURL string `json:"statuses_url"`
|
CommentsURL string `json:"comments_url"`
|
||||||
|
StatusesURL string `json:"statuses_url"`
|
||||||
RequestedReviewers []struct {
|
RequestedReviewers []struct {
|
||||||
Login string `json:"login"`
|
Login string `json:"login"`
|
||||||
ID int `json:"id"`
|
ID int `json:"id"`
|
||||||
@@ -3168,6 +3172,7 @@ type PullRequestPayload struct {
|
|||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
SiteAdmin bool `json:"site_admin"`
|
SiteAdmin bool `json:"site_admin"`
|
||||||
} `json:"sender"`
|
} `json:"sender"`
|
||||||
|
Assignee *Assignee `json:"assignee"`
|
||||||
Installation struct {
|
Installation struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
} `json:"installation"`
|
} `json:"installation"`
|
||||||
@@ -3694,19 +3699,20 @@ type PullRequestReviewCommentPayload struct {
|
|||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
SiteAdmin bool `json:"site_admin"`
|
SiteAdmin bool `json:"site_admin"`
|
||||||
} `json:"user"`
|
} `json:"user"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
ClosedAt *time.Time `json:"closed_at"`
|
ClosedAt *time.Time `json:"closed_at"`
|
||||||
MergedAt *time.Time `json:"merged_at"`
|
MergedAt *time.Time `json:"merged_at"`
|
||||||
MergeCommitSha string `json:"merge_commit_sha"`
|
MergeCommitSha string `json:"merge_commit_sha"`
|
||||||
Assignee *Assignee `json:"assignee"`
|
Assignee *Assignee `json:"assignee"`
|
||||||
Milestone *Milestone `json:"milestone"`
|
Assignees []*Assignee `json:"assignees"`
|
||||||
CommitsURL string `json:"commits_url"`
|
Milestone *Milestone `json:"milestone"`
|
||||||
ReviewCommentsURL string `json:"review_comments_url"`
|
CommitsURL string `json:"commits_url"`
|
||||||
ReviewCommentURL string `json:"review_comment_url"`
|
ReviewCommentsURL string `json:"review_comments_url"`
|
||||||
CommentsURL string `json:"comments_url"`
|
ReviewCommentURL string `json:"review_comment_url"`
|
||||||
StatusesURL string `json:"statuses_url"`
|
CommentsURL string `json:"comments_url"`
|
||||||
|
StatusesURL string `json:"statuses_url"`
|
||||||
Head struct {
|
Head struct {
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
Ref string `json:"ref"`
|
Ref string `json:"ref"`
|
||||||
|
|||||||
+9
-1
@@ -177,10 +177,18 @@ type Build struct {
|
|||||||
When string `json:"when"`
|
When string `json:"when"`
|
||||||
Manual bool `json:"manual"`
|
Manual bool `json:"manual"`
|
||||||
User User `json:"user"`
|
User User `json:"user"`
|
||||||
Runner string `json:"runner"`
|
Runner Runner `json:"runner"`
|
||||||
ArtifactsFile ArtifactsFile `json:"artifactsfile"`
|
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
|
// ArtifactsFile contains all of the GitLab artifact information
|
||||||
type ArtifactsFile struct {
|
type ArtifactsFile struct {
|
||||||
Filename string `json:"filename"`
|
Filename string `json:"filename"`
|
||||||
|
|||||||
Reference in New Issue
Block a user