Allow passed in env vars to supersede ones declared in the workflow (#1100)
* don't merge env var if it exists already * remove test workflow * add some tests * change mergeMaps order instead of checking for existence Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
@@ -75,7 +75,7 @@ func (rc *RunContext) String() string {
|
||||
// GetEnv returns the env for the context
|
||||
func (rc *RunContext) GetEnv() map[string]string {
|
||||
if rc.Env == nil {
|
||||
rc.Env = mergeMaps(rc.Config.Env, rc.Run.Workflow.Env, rc.Run.Job().Environment())
|
||||
rc.Env = mergeMaps(rc.Run.Workflow.Env, rc.Run.Job().Environment(), rc.Config.Env)
|
||||
}
|
||||
rc.Env["ACT"] = "true"
|
||||
return rc.Env
|
||||
|
Reference in New Issue
Block a user