Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Casey Lee
2020-02-10 16:53:14 -08:00
parent ac8258db4b
commit 835b36cb63
8 changed files with 50 additions and 20 deletions

View File

@@ -45,7 +45,10 @@ func (rc *RunContext) Close(ctx context.Context) error {
// Executor returns a pipeline executor for all the steps in the job
func (rc *RunContext) Executor() common.Executor {
rc.setupTempDir()
err := rc.setupTempDir()
if err != nil {
return common.NewErrorExecutor(err)
}
steps := make([]common.Executor, 0)
for i, step := range rc.Run.Job().Steps {
@@ -74,7 +77,13 @@ func (rc *RunContext) setupTempDir() error {
tempBase = "/tmp"
}
rc.Tempdir, err = ioutil.TempDir(tempBase, "act-")
os.Chmod(rc.Tempdir, 0755)
if err != nil {
return err
}
err = os.Chmod(rc.Tempdir, 0755)
if err != nil {
return err
}
log.Debugf("Setup tempdir %s", rc.Tempdir)
return err
}