Merge pull request #1055 from JeanMertz/0.4.0-ignore-commits

ignore GH "push" event when ref is deleted
This commit is contained in:
Brad Rydzewski 2015-06-13 01:20:06 -07:00
commit 2d9f87f777

View file

@ -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"`