ignore GH "push" event when ref is deleted
This commit is contained in:
parent
c59d02a64c
commit
8dfb9cfcd7
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 {
|
||||||
|
@ -336,7 +340,8 @@ 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