only inject ssk key if private repository or pull request
This commit is contained in:
parent
61282888e1
commit
76fd8b0d66
1 changed files with 4 additions and 1 deletions
|
@ -122,10 +122,13 @@ func (d *Docker) Do(c context.Context, r *worker.Work) {
|
||||||
builder.Build = script
|
builder.Build = script
|
||||||
builder.Repo = repo
|
builder.Repo = repo
|
||||||
builder.Stdout = buf
|
builder.Stdout = buf
|
||||||
builder.Key = []byte(r.Repo.PrivateKey)
|
|
||||||
builder.Timeout = time.Duration(r.Repo.Timeout) * time.Second
|
builder.Timeout = time.Duration(r.Repo.Timeout) * time.Second
|
||||||
builder.Privileged = r.Repo.Privileged
|
builder.Privileged = r.Repo.Privileged
|
||||||
|
|
||||||
|
if r.Repo.Private || len(r.Commit.PullRequest) == 0 {
|
||||||
|
builder.Key = []byte(r.Repo.PrivateKey)
|
||||||
|
}
|
||||||
|
|
||||||
// run the build
|
// run the build
|
||||||
err = builder.Run()
|
err = builder.Run()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue