Add proper support for working-directory & fix command builder (#772)

* fix: align other Docker executors to print action

* fix: formatting

* fix: add proper workdir support

* fix: replace script filepath after slice creation

* fix: match substring so it works for pwsh

+ rename containerPath to scriptPath to reflect what value it contains
This commit is contained in:
Ryan
2021-08-10 19:40:20 +00:00
committed by GitHub
parent 77b3968913
commit bea32d5651
6 changed files with 76 additions and 36 deletions

View File

@@ -8,6 +8,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- run: '[[ "$(pwd)" == "${GITHUB_WORKSPACE}" ]]'
- run: echo ${{ env.TEST }} | grep value
- run: env
- uses: docker://node:12-buster-slim

View File

@@ -0,0 +1,7 @@
---
jobs:
dir-with-spaces:
runs-on: ubuntu-latest
steps:
- run: echo "$PWD"
'on': push

View File

@@ -1,15 +1,24 @@
name: workdir
on: push
defaults:
run:
working-directory: /tmp
jobs:
workdir:
runs-on: ubuntu-latest
defaults:
run:
working-directory: /root
steps:
- run: mkdir -p "${GITHUB_WORKSPACE}/workdir"
- run: '[[ "$(pwd)" == "${GITHUB_WORKSPACE}/workdir" ]]'
working-directory: workdir
- run: '[[ "$(pwd)" == "/root" ]]'
noworkdir:
- run: mkdir -p "${GITHUB_WORKSPACE}/workdir"
- run: '[[ "$(pwd)" == "${GITHUB_WORKSPACE}/workdir" ]]'
working-directory: workdir
top-level-workdir:
runs-on: ubuntu-latest
steps:
- run: '[[ "$(pwd)" == "${GITHUB_WORKSPACE}" ]]'
- run: '[[ "$(pwd)" == "/tmp" ]]'