Compare commits

..

14 Commits

Author SHA1 Message Date
Dean Karn 26ca2ef893 Update README.md 2018-11-21 07:54:37 -08:00
Dean Karn 4fb25871a6 Update .travis.yml 2018-11-21 07:54:00 -08:00
Dean Karn 22a6a67d07 Update .travis.yml 2018-11-21 07:53:44 -08:00
Dean Karn d7570ff094 Merge pull request #52 from pieterlexis/add-assignees-to-issues
Add Assignees struct to IssuesPayload as well
2018-11-21 07:52:15 -08:00
Pieter Lexis 2dbe987740 Add a singular 'Assignee' field to PR and Issue payloads
This is present when the action for a PR or Issue is "assigned" or
"unassiged", detailing the user assigned or unassiged.
2018-11-05 15:12:41 +01:00
Pieter Lexis b3a5a8edf7 Add Assignees struct to IssuesPayload as well 2018-11-05 14:39:37 +01:00
Dean Karn dfc330f6eb Update README.md 2018-11-04 07:05:03 -08:00
Dean Karn cdc59eb3ef Merge pull request #51 from pieterlexis/add-assignees
GitHub Payloads: Add `Assignees` where needed
2018-11-04 07:04:26 -08:00
Pieter Lexis a39ebc145a GitHub Payloads: Add Assignees where needed
Closes #50
2018-11-02 20:15:14 +01:00
Dean Karn 24279ccb4b Merge pull request #46 from xackery/v5
Added runner to gitlab
2018-10-24 12:36:30 -07:00
Xackery Xtal 4708dcb9f1 Added runner to gitlab 2018-10-19 18:28:45 -07:00
Dean Karn 3fda9e72e1 Update README.md 2018-08-09 12:30:00 -07:00
Dean Karn a610eb250e Merge pull request #43 from go-playground/bb-uuid-check-enhancement
only validate UUID header when expecting one
2018-08-09 12:28:51 -07:00
Dean Karn f583341fb8 only validate UUID header when expecting one 2018-08-09 12:26:52 -07:00
5 changed files with 63 additions and 49 deletions
+2 -2
View File
@@ -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 -1
View File
@@ -1,6 +1,6 @@
Library webhooks Library webhooks
================ ================
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v5/logo.png">![Project status](https://img.shields.io/badge/version-5.0.0-green.svg) <img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v5/logo.png">![Project status](https://img.shields.io/badge/version-5.3.0-green.svg)
[![Build Status](https://travis-ci.org/go-playground/webhooks.svg?branch=v5)](https://travis-ci.org/go-playground/webhooks) [![Build Status](https://travis-ci.org/go-playground/webhooks.svg?branch=v5)](https://travis-ci.org/go-playground/webhooks)
[![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v5&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v5) [![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v5&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v5)
[![Go Report Card](https://goreportcard.com/badge/go-playground/webhooks)](https://goreportcard.com/report/go-playground/webhooks) [![Go Report Card](https://goreportcard.com/badge/go-playground/webhooks)](https://goreportcard.com/report/go-playground/webhooks)
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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"`