diff --git a/pkg/runner/step_context.go b/pkg/runner/step_context.go index 57be09a..baa88a5 100644 --- a/pkg/runner/step_context.go +++ b/pkg/runner/step_context.go @@ -467,24 +467,30 @@ func (sc *StepContext) runAction(actionDir string, actionPath string, localActio sc.Env = mergeMaps(sc.Env, action.Runs.Env) - log.Debugf("type=%v actionDir=%s actionPath=%s Workdir=%s ActionCacheDir=%s actionName=%s containerActionDir=%s", step.Type(), actionDir, actionPath, rc.Config.Workdir, rc.ActionCacheDir(), actionName, containerActionDir) + log.Debugf("type=%v actionDir=%s actionPath=%s workdir=%s actionCacheDir=%s actionName=%s containerActionDir=%s", step.Type(), actionDir, actionPath, rc.Config.Workdir, rc.ActionCacheDir(), actionName, containerActionDir) maybeCopyToActionDir := func() error { sc.Env["GITHUB_ACTION_PATH"] = containerActionDir if step.Type() != model.StepTypeUsesActionRemote { return nil } - err := removeGitIgnore(actionDir) - if err != nil { + if err := removeGitIgnore(actionDir); err != nil { return err } - return rc.JobContainer.CopyDir(containerActionDir+"/", actionLocation+"/", rc.Config.UseGitIgnore)(ctx) + + var containerActionDirCopy string + containerActionDirCopy = strings.TrimSuffix(containerActionDir, actionPath) + log.Debug(containerActionDirCopy) + + if !strings.HasSuffix(containerActionDirCopy, `/`) { + containerActionDirCopy += `/` + } + return rc.JobContainer.CopyDir(containerActionDirCopy, actionDir+"/", rc.Config.UseGitIgnore)(ctx) } switch action.Runs.Using { case model.ActionRunsUsingNode12: - err := maybeCopyToActionDir() - if err != nil { + if err := maybeCopyToActionDir(); err != nil { return err } containerArgs := []string{"node", path.Join(containerActionDir, action.Runs.Main)}