fix docker executor on windows and local actions ()

If the Workdir field doesn't ends with the filepath seperator,
bad things happen

Fixes 

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 <christopher.homberger@web.de>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/34
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ChristopherHX <christopherhx@noreply.gitea.io>
Co-committed-by: ChristopherHX <christopherhx@noreply.gitea.io>
This commit is contained in:
ChristopherHX 2023-03-06 13:24:32 +08:00 committed by Earl Warren
parent 8833fca093
commit cbf360f543
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -206,7 +206,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,