Made env interpolated instead of evaluated. (#1222)

* Made env interpolated instead of evaluated.

* [skip ci] Add Test Workflow file

* Activate Test

* fix Test

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
This commit is contained in:
Grigory Entin
2022-07-27 21:46:04 +02:00
committed by GitHub
parent 17dd54d692
commit ddee19b946
3 changed files with 23 additions and 5 deletions

View File

@@ -14,7 +14,6 @@ import (
"github.com/nektos/act/pkg/common"
"github.com/nektos/act/pkg/container"
"github.com/nektos/act/pkg/exprparser"
"github.com/nektos/act/pkg/model"
)
@@ -165,10 +164,7 @@ func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
// evaluate environment variables since they can contain
// GitHub's special environment variables.
for k, v := range rc.GetEnv() {
valueEval, err := rc.ExprEval.evaluate(ctx, v, exprparser.DefaultStatusCheckNone)
if err == nil {
rc.Env[k] = fmt.Sprintf("%v", valueEval)
}
rc.Env[k] = rc.ExprEval.Interpolate(ctx, v)
}
if len(rc.String()) > maxJobNameLen {
maxJobNameLen = len(rc.String())