Compare commits
8 Commits
v6
...
v6.0.0-beta.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c382736e0 | |||
| ec227ef416 | |||
| e55d994db5 | |||
| 66bfeb55b9 | |||
| e1c6b6436c | |||
| 598a1cf5be | |||
| f3cedb24ac | |||
| 82e53669b8 |
@@ -0,0 +1,52 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
name: Test
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Run linter
|
||||||
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
with:
|
||||||
|
version: v1.35.2
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: [1.14.x, 1.15.x]
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Restore cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-v1-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-v1-go-
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: go test -race -covermode=atomic -coverprofile="coverage.out" ./...
|
||||||
|
|
||||||
|
- name: Upload coverage report to Coveralls
|
||||||
|
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.15.x'
|
||||||
|
uses: shogo82148/actions-goveralls@v1
|
||||||
|
with:
|
||||||
|
path-to-profile: coverage.out
|
||||||
-28
@@ -1,28 +0,0 @@
|
|||||||
language: go
|
|
||||||
go:
|
|
||||||
- 1.15.6
|
|
||||||
- tip
|
|
||||||
matrix:
|
|
||||||
allow_failures:
|
|
||||||
- go: tip
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
recipients: dean.karn@gmail.com
|
|
||||||
on_success: change
|
|
||||||
on_failure: always
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- go get -u github.com/mattn/goveralls
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- go mod download
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make lint
|
|
||||||
- make test
|
|
||||||
|
|
||||||
after_success: |
|
|
||||||
[ $TRAVIS_GO_VERSION = 1.15.6 ] &&
|
|
||||||
go test ./... -covermode=count -coverprofile=coverage.out &&
|
|
||||||
goveralls -coverprofile=coverage.out -service travis-ci -repotoken $COVERALLS_TOKEN
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
GOPATH=$(shell go env GOPATH)
|
GOPATH=$(shell go env GOPATH)
|
||||||
|
|
||||||
|
all: lint test
|
||||||
|
|
||||||
linters-install:
|
linters-install:
|
||||||
@echo "+ $@"
|
@echo "+ $@"
|
||||||
@$(GOPATH)/bin/golangci-lint --version >/dev/null 2>&1 || { \
|
@$(GOPATH)/bin/golangci-lint --version >/dev/null 2>&1 || { \
|
||||||
@@ -12,6 +14,8 @@ lint: linters-install
|
|||||||
$(GOPATH)/bin/golangci-lint run ./...
|
$(GOPATH)/bin/golangci-lint run ./...
|
||||||
|
|
||||||
test:
|
test:
|
||||||
GO111MODULE=on go test -cover -race ./...
|
@echo "+ $@"
|
||||||
|
GO111MODULE=on go test -covermode=atomic -race ./...
|
||||||
|
|
||||||
.PHONY: test lint linters-install
|
.PHONY: test lint linters-install
|
||||||
|
.DEFAULT_GOAL := all
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
Library webhooks
|
Library webhooks
|
||||||
================
|
================
|
||||||
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v6/logo.png">
|
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v6/logo.png">
|
||||||
[](https://travis-ci.org/go-playground/webhooks)
|
[](https://github.com/go-playground/webhooks/actions)
|
||||||
[](https://coveralls.io/github/go-playground/webhooks?branch=v6)
|
[](https://coveralls.io/github/go-playground/webhooks?branch=master)
|
||||||
[](https://goreportcard.com/report/go-playground/webhooks)
|
[](https://goreportcard.com/report/go-playground/webhooks)
|
||||||
[](https://godoc.org/github.com/go-playground/webhooks/v6)
|
[](https://godoc.org/github.com/go-playground/webhooks/v6)
|
||||||

|

|
||||||
|
|||||||
@@ -187,6 +187,9 @@ type CheckRunPayload struct {
|
|||||||
Watchers int64 `json:"watchers"`
|
Watchers int64 `json:"watchers"`
|
||||||
DefaultBranch string `json:"default_branch"`
|
DefaultBranch string `json:"default_branch"`
|
||||||
} `json:"repository"`
|
} `json:"repository"`
|
||||||
|
Installation struct {
|
||||||
|
ID int64 `json:"id"`
|
||||||
|
} `json:"installation,omitempty"`
|
||||||
Sender struct {
|
Sender struct {
|
||||||
Login string `json:"login"`
|
Login string `json:"login"`
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
@@ -359,6 +362,9 @@ type CheckSuitePayload struct {
|
|||||||
Watchers int64 `json:"watchers"`
|
Watchers int64 `json:"watchers"`
|
||||||
DefaultBranch string `json:"default_branch"`
|
DefaultBranch string `json:"default_branch"`
|
||||||
} `json:"repository"`
|
} `json:"repository"`
|
||||||
|
Installation struct {
|
||||||
|
ID int64 `json:"id"`
|
||||||
|
} `json:"installation,omitempty"`
|
||||||
Sender struct {
|
Sender struct {
|
||||||
Login string `json:"login"`
|
Login string `json:"login"`
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
|
|||||||
@@ -274,15 +274,6 @@ func TestJobHooks(t *testing.T) {
|
|||||||
filename string
|
filename string
|
||||||
headers http.Header
|
headers http.Header
|
||||||
}{
|
}{
|
||||||
{
|
|
||||||
name: "JobEvent",
|
|
||||||
events: []Event{JobEvents},
|
|
||||||
typ: JobEventPayload{},
|
|
||||||
filename: "../testdata/gitlab/job-event.json",
|
|
||||||
headers: http.Header{
|
|
||||||
"X-Gitlab-Event": []string{"Job Hook"},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "JobEvent",
|
name: "JobEvent",
|
||||||
events: []Event{JobEvents, BuildEvents},
|
events: []Event{JobEvents, BuildEvents},
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ type MergeRequestEventPayload struct {
|
|||||||
Project Project `json:"project"`
|
Project Project `json:"project"`
|
||||||
Repository Repository `json:"repository"`
|
Repository Repository `json:"repository"`
|
||||||
Labels []Label `json:"labels"`
|
Labels []Label `json:"labels"`
|
||||||
|
Assignees []Assignee `json:"assignees"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PushEventPayload contains the information for GitLab's push event
|
// PushEventPayload contains the information for GitLab's push event
|
||||||
@@ -449,9 +450,11 @@ type MergeRequest struct {
|
|||||||
|
|
||||||
// Assignee contains all of the GitLab assignee information
|
// Assignee contains all of the GitLab assignee information
|
||||||
type Assignee struct {
|
type Assignee struct {
|
||||||
|
ID int64 `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
AvatarURL string `json:"avatar_url"`
|
AvatarURL string `json:"avatar_url"`
|
||||||
|
Email string `json:"email"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StDiff contains all of the GitLab diff information
|
// StDiff contains all of the GitLab diff information
|
||||||
|
|||||||
+10
-1
@@ -136,5 +136,14 @@
|
|||||||
"group_id": 41
|
"group_id": 41
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"assignees": [
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"name": "User1",
|
||||||
|
"username": "user1",
|
||||||
|
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon",
|
||||||
|
"email": "user1@gmail.com"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user