From e36300ce286cabc4fad58894c595ecb17cf6fcdf Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Mon, 6 Mar 2023 13:24:32 +0800 Subject: [PATCH] fix docker executor on windows and local actions (#34) If the Workdir field doesn't ends with the filepath seperator, bad things happen Fixes #33 Sample for host mode on windows, needs be adjusted for linux e.g. replace pwsh with bash Also fixes ```yaml on: push jobs: _: runs-on: self-hosted steps: - uses: actions/checkout@v3 with: path: subdir/action - uses: ./subdir/action ``` with an action.yml in the same repo ```yaml runs: using: composite steps: - run: | echo "Hello World" shell: pwsh ``` Co-authored-by: Christopher Homberger Reviewed-on: https://gitea.com/gitea/act_runner/pulls/34 Reviewed-by: Jason Song Reviewed-by: Lunny Xiao Co-authored-by: ChristopherHX Co-committed-by: ChristopherHX --- runtime/task.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/task.go b/runtime/task.go index f7ff652..9fc9a64 100644 --- a/runtime/task.go +++ b/runtime/task.go @@ -209,7 +209,7 @@ func (t *Task) Run(ctx context.Context, task *runnerv1.Task) (lastErr error) { input := t.Input config := &runner.Config{ - Workdir: "/" + preset.Repository, + Workdir: "." + string(filepath.Separator), BindWorkdir: false, ReuseContainers: false, ForcePull: input.forcePull,