From 8dfb9cfcd7f24a4c0f269f8f3aaddcab94590103 Mon Sep 17 00:00:00 2001 From: Jean Mertz Date: Thu, 11 Jun 2015 19:17:14 +0200 Subject: [PATCH 1/2] ignore GH "push" event when ref is deleted --- pkg/remote/builtin/github/github.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/remote/builtin/github/github.go b/pkg/remote/builtin/github/github.go index 9ff0fe07..5b6fafd8 100644 --- a/pkg/remote/builtin/github/github.go +++ b/pkg/remote/builtin/github/github.go @@ -251,6 +251,10 @@ func (g *GitHub) push(r *http.Request) (*common.Hook, error) { return nil, err } + if hook.Deleted { + return nil, nil + } + repo := &common.Repo{} repo.Owner = hook.Repo.Owner.Login if len(repo.Owner) == 0 { @@ -336,7 +340,8 @@ func (g *GitHub) pullRequest(r *http.Request) (*common.Hook, error) { } type pushHook struct { - Ref string `json:"ref"` + Ref string `json:"ref"` + Deleted bool `json:"deleted"` Head struct { ID string `json:"id"` From e98a0950d54c1cf052e61c004bcd9bc2eec541de Mon Sep 17 00:00:00 2001 From: djamel Date: Thu, 11 Jun 2015 13:52:24 +0100 Subject: [PATCH 2/2] adapt drone.toml to new version --- README.md | 3 ++- dist/drone/etc/drone/drone.toml | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3d398581..1db803a5 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ secret = "" expires = "" [database] -path = "/etc/drone/drone.db" +driver="sqlite3" +datasource="/var/lib/drone/drone.sqlite" [docker] cert = "" diff --git a/dist/drone/etc/drone/drone.toml b/dist/drone/etc/drone/drone.toml index 4fb4f0c0..195c8cf6 100644 --- a/dist/drone/etc/drone/drone.toml +++ b/dist/drone/etc/drone/drone.toml @@ -8,7 +8,8 @@ key = "" # expires = "" [database] -path = "/var/lib/drone/drone.sqlite" +driver="sqlite3" +datasource="/var/lib/drone/drone.sqlite" [docker] cert = "" @@ -16,7 +17,7 @@ key = "" addr = "unix:///var/run/docker.sock" swarm = "" -# [service] +# [remote] # kind = "github" # base = "https://github.com" # orgs = [] @@ -33,4 +34,3 @@ swarm = "" # [agents] # secret = "" -