only inject ssk key if private repository or pull request

This commit is contained in:
Brad Rydzewski 2014-12-30 10:35:44 -08:00
parent 61282888e1
commit 76fd8b0d66

View file

@ -122,10 +122,13 @@ func (d *Docker) Do(c context.Context, r *worker.Work) {
builder.Build = script
builder.Repo = repo
builder.Stdout = buf
builder.Key = []byte(r.Repo.PrivateKey)
builder.Timeout = time.Duration(r.Repo.Timeout) * time.Second
builder.Privileged = r.Repo.Privileged
if r.Repo.Private || len(r.Commit.PullRequest) == 0 {
builder.Key = []byte(r.Repo.PrivateKey)
}
// run the build
err = builder.Run()