From d4c7e7bf5901f77317920d3dc30ff14432b58ff0 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 3 Sep 2015 23:56:52 -0700 Subject: [PATCH] fix logic to detect if pull request --- pkg/runner/builtin/runner.go | 2 +- pkg/server/commits.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/runner/builtin/runner.go b/pkg/runner/builtin/runner.go index 63de4729..60d98a68 100644 --- a/pkg/runner/builtin/runner.go +++ b/pkg/runner/builtin/runner.go @@ -155,7 +155,7 @@ func (r *Runner) Run(w *queue.Work) error { worker := newWorker(client) workers = append(workers, worker) cname := cname(job) - pullrequest := (w.Build.PullRequest != nil) + pullrequest := (w.Build.PullRequest != nil && w.Build.PullRequest.Number != 0) state, builderr := worker.Build(cname, in, pullrequest) switch { diff --git a/pkg/server/commits.go b/pkg/server/commits.go index 2404ee8e..870271b8 100644 --- a/pkg/server/commits.go +++ b/pkg/server/commits.go @@ -6,6 +6,7 @@ import ( "strconv" "time" + log "github.com/drone/drone/Godeps/_workspace/src/github.com/Sirupsen/logrus" "github.com/drone/drone/Godeps/_workspace/src/github.com/gin-gonic/gin" "github.com/drone/drone/pkg/queue" common "github.com/drone/drone/pkg/types" @@ -184,7 +185,10 @@ func RunBuild(c *gin.Context) { if repo.Params != nil && len(repo.Params) != 0 { raw = []byte(inject.InjectSafe(string(raw), repo.Params)) } - encrypted, _ := secure.Parse(repo.Keys.Private, repo.Hash, string(raw)) + encrypted, err := secure.Parse(repo.Keys.Private, repo.Hash, string(raw)) + if err != nil { + log.Errorf("failure to decrypt secure parameters for %s. %s", repo.FullName, err) + } if encrypted != nil && len(encrypted) != 0 { raw = []byte(inject.InjectSafe(string(raw), encrypted)) }