Skip to content

Commit

Permalink
fix: move envs.txt & event.json to /tmp/
Browse files Browse the repository at this point in the history
Since nektos#635 `envs.txt` is not copying properly when running `act` in WSL2
Moving it to fixed location resolves that.
  • Loading branch information
hackercat committed May 5, 2021
1 parent 0f1df59 commit f028d20
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,14 @@ func (rc *RunContext) startJobContainer() common.Executor {
rc.JobContainer.Start(false),
rc.JobContainer.UpdateFromEnv("/etc/environment", &rc.Env),
rc.JobContainer.CopyDir(copyToPath, rc.Config.Workdir+string(filepath.Separator)+".", rc.Config.UseGitIgnore).IfBool(copyWorkspace),
rc.JobContainer.Copy(rc.Config.ContainerWorkdir(), &container.FileEntry{
rc.JobContainer.Copy("/tmp/", &container.FileEntry{
Name: "workflow/event.json",
Mode: 0644,
Body: rc.EventJSON,
}, &container.FileEntry{
Name: "workflow/envs.txt",
Mode: 0644,
Body: "",
}, &container.FileEntry{
Name: "home/.act",
Mode: 0644,
Body: "",
}),
)(ctx)
}
Expand Down Expand Up @@ -628,7 +624,7 @@ func withDefaultBranch(b string, event map[string]interface{}) map[string]interf
func (rc *RunContext) withGithubEnv(env map[string]string) map[string]string {
github := rc.getGithubContext()
env["CI"] = "true"
env["GITHUB_ENV"] = fmt.Sprintf("%s/%s", rc.Config.ContainerWorkdir(), "workflow/envs.txt")
env["GITHUB_ENV"] = "/tmp/workflow/envs.txt"
env["GITHUB_WORKFLOW"] = github.Workflow
env["GITHUB_RUN_ID"] = github.RunID
env["GITHUB_RUN_NUMBER"] = github.RunNumber
Expand Down

0 comments on commit f028d20

Please sign in to comment.