Merge pull request #1055 from JeanMertz/0.4.0-ignore-commits
ignore GH "push" event when ref is deleted
This commit is contained in:
commit
2d9f87f777
1 changed files with 6 additions and 1 deletions
|
@ -251,6 +251,10 @@ func (g *GitHub) push(r *http.Request) (*common.Hook, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if hook.Deleted {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
repo := &common.Repo{}
|
repo := &common.Repo{}
|
||||||
repo.Owner = hook.Repo.Owner.Login
|
repo.Owner = hook.Repo.Owner.Login
|
||||||
if len(repo.Owner) == 0 {
|
if len(repo.Owner) == 0 {
|
||||||
|
@ -337,6 +341,7 @@ func (g *GitHub) pullRequest(r *http.Request) (*common.Hook, error) {
|
||||||
|
|
||||||
type pushHook struct {
|
type pushHook struct {
|
||||||
Ref string `json:"ref"`
|
Ref string `json:"ref"`
|
||||||
|
Deleted bool `json:"deleted"`
|
||||||
|
|
||||||
Head struct {
|
Head struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
|
Loading…
Reference in a new issue