Fix environment variables and move envs.txt/event.json to fixed location (#667)

* fix: environment variables sourcing from `/etc/environment`

* fix: move `envs.txt` & `event.json` to `/tmp/`

Since #635 `envs.txt` is not copying properly when running `act` in WSL2
Moving it to fixed location resolves that.
This commit is contained in:
Ryan (hackercat)
2021-05-06 01:11:43 +02:00
committed by GitHub
parent aba4fec0ee
commit 8153dc92e5
4 changed files with 19 additions and 18 deletions

View File

@@ -113,8 +113,7 @@ func (sc *StepContext) mergeEnv() map[string]string {
}
if (rc.ExtraPath != nil) && (len(rc.ExtraPath) > 0) {
s := append(rc.ExtraPath, `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`)
env["PATH"] = strings.Join(s, `:`)
env["PATH"] = strings.Join(rc.ExtraPath, `:`)
}
sc.Env = rc.withGithubEnv(env)
@@ -131,7 +130,7 @@ func (sc *StepContext) setupEnv(ctx context.Context) (ExpressionEvaluator, error
rc := sc.RunContext
sc.Env = sc.mergeEnv()
if sc.Env != nil {
err := rc.JobContainer.UpdateFromGithubEnv(&sc.Env)(ctx)
err := rc.JobContainer.UpdateFromEnv(sc.Env["GITHUB_ENV"], &sc.Env)(ctx)
if err != nil {
return nil, err
}