mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-19 08:18:22 +00:00
Merge pull request #1055 from JeanMertz/0.4.0-ignore-commits
ignore GH "push" event when ref is deleted
This commit is contained in:
@@ -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"`
|
||||||
|
Reference in New Issue
Block a user