mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 01:19:02 +01:00
Provide global environment variables for pipeline substitution (#968)
* make global environment variables available for pipeline substitution * lint fixes * global env support in cli exec; procBuilder tests * drop GLOBAL_ prefix * docs * documentation typo * Update docs/docs/20-usage/50-environment.md as suggested by anbraten Co-authored-by: Anbraten <anton@ju60.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
@@ -110,6 +110,11 @@ func execWithAxis(c *cli.Context, file, repoPath string, axis matrix.Axis) error
|
||||
for _, env := range c.StringSlice("env") {
|
||||
envs := strings.SplitN(env, "=", 2)
|
||||
droneEnv[envs[0]] = envs[1]
|
||||
if _, exists := environ[envs[0]]; exists {
|
||||
// don't override existing values
|
||||
continue
|
||||
}
|
||||
environ[envs[0]] = envs[1]
|
||||
}
|
||||
|
||||
tmpl, err := envsubst.ParseFile(file)
|
||||
|
||||
Reference in New Issue
Block a user