mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-25 21:59:54 +00:00
only inject private parameters for non-pull requests, for security purposes
This commit is contained in:
@@ -108,8 +108,9 @@ func (w *worker) execute(task *BuildTask) error {
|
|||||||
var buf = &bufferWrapper{channel: consoleslug}
|
var buf = &bufferWrapper{channel: consoleslug}
|
||||||
|
|
||||||
// append private parameters to the environment
|
// append private parameters to the environment
|
||||||
// variable section of the .drone.yml file
|
// variable section of the .drone.yml file, iff
|
||||||
if task.Repo.Params != nil {
|
// this is not a pull request (for security purposes)
|
||||||
|
if task.Repo.Params != nil && len(task.Commit.PullRequest) == 0 {
|
||||||
for k, v := range task.Repo.Params {
|
for k, v := range task.Repo.Params {
|
||||||
task.Script.Env = append(task.Script.Env, k+"="+v)
|
task.Script.Env = append(task.Script.Env, k+"="+v)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user