mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-02 04:24:56 +00:00
only inject ssk key if private repository or pull request
This commit is contained in:
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user