use project dir instead of /github/workspace (#567)
This commit is contained in:
@@ -160,7 +160,7 @@ func (sc *StepContext) setupShellCommand() common.Executor {
|
||||
}
|
||||
scriptName := fmt.Sprintf("workflow/%s", step.ID)
|
||||
log.Debugf("Wrote command '%s' to '%s'", run, scriptName)
|
||||
containerPath := fmt.Sprintf("/github/%s", scriptName)
|
||||
containerPath := fmt.Sprintf("%s/%s", filepath.Dir(rc.Config.Workdir), scriptName)
|
||||
|
||||
if step.Shell == "" {
|
||||
step.Shell = rc.Run.Job().Defaults.Run.Shell
|
||||
@@ -169,7 +169,7 @@ func (sc *StepContext) setupShellCommand() common.Executor {
|
||||
step.Shell = rc.Run.Workflow.Defaults.Run.Shell
|
||||
}
|
||||
sc.Cmd = strings.Fields(strings.Replace(step.ShellCommand(), "{0}", containerPath, 1))
|
||||
return rc.JobContainer.Copy("/github/", &container.FileEntry{
|
||||
return rc.JobContainer.Copy(fmt.Sprintf("%s/", filepath.Dir(rc.Config.Workdir)), &container.FileEntry{
|
||||
Name: scriptName,
|
||||
Mode: 0755,
|
||||
Body: script.String(),
|
||||
@@ -214,7 +214,7 @@ func (sc *StepContext) newStepContainer(ctx context.Context, image string, cmd [
|
||||
fmt.Sprintf("%s:%s", "/var/run/docker.sock", "/var/run/docker.sock"),
|
||||
}
|
||||
if rc.Config.BindWorkdir {
|
||||
binds = append(binds, fmt.Sprintf("%s:%s%s", rc.Config.Workdir, "/github/workspace", bindModifiers))
|
||||
binds = append(binds, fmt.Sprintf("%s:%s%s", rc.Config.Workdir, rc.Config.Workdir, bindModifiers))
|
||||
}
|
||||
|
||||
if rc.Config.ContainerArchitecture == "" {
|
||||
@@ -224,12 +224,12 @@ func (sc *StepContext) newStepContainer(ctx context.Context, image string, cmd [
|
||||
stepContainer := container.NewContainer(&container.NewContainerInput{
|
||||
Cmd: cmd,
|
||||
Entrypoint: entrypoint,
|
||||
WorkingDir: "/github/workspace",
|
||||
WorkingDir: rc.Config.Workdir,
|
||||
Image: image,
|
||||
Name: createContainerName(rc.jobContainerName(), step.ID),
|
||||
Env: envList,
|
||||
Mounts: map[string]string{
|
||||
rc.jobContainerName(): "/github",
|
||||
rc.jobContainerName(): filepath.Dir(rc.Config.Workdir),
|
||||
"act-toolcache": "/toolcache",
|
||||
"act-actions": "/actions",
|
||||
},
|
||||
@@ -299,7 +299,7 @@ func (sc *StepContext) getContainerActionPaths(step *model.Step, actionDir strin
|
||||
containerActionDir := "."
|
||||
if step.Type() == model.StepTypeUsesActionLocal {
|
||||
actionName = getOsSafeRelativePath(actionDir, rc.Config.Workdir)
|
||||
containerActionDir = "/github/workspace"
|
||||
containerActionDir = rc.Config.Workdir
|
||||
} else if step.Type() == model.StepTypeUsesActionRemote {
|
||||
actionName = getOsSafeRelativePath(actionDir, rc.ActionCacheDir())
|
||||
containerActionDir = "/actions"
|
||||
|
Reference in New Issue
Block a user