fix: rework setupShellCommand (#930)

* fix: rework `setupShellCommand`

* move all logic to separate function so we can test that later
* split `step.Shell` and `step.WorkingDirectory` setup into own funcs
* general cleanup of function
* use `ActPath` to not collide with checked out repository
* use `shellquote.Split()` instead of `strings.Fields()` for better command split
* replace single string concat with `fmt`

Signed-off-by: hackercat <me@hackerc.at>

* lint(editorconfig): ignore *_test.go due to mixed style

Signed-off-by: hackercat <me@hackerc.at>
This commit is contained in:
Ryan
2021-12-22 07:37:16 +01:00
committed by GitHub
parent 4e0ba618d3
commit adabf2a202
9 changed files with 168 additions and 83 deletions

View File

@@ -0,0 +1,14 @@
on: push
jobs:
check:
runs-on: ubuntu-latest
steps:
# prints version and exits, it's not valid (for github) if {0} is not included
- shell: pwsh -v '. {0}'
run: ''
check-container:
runs-on: ubuntu-latest
container: ghcr.io/justingrote/act-pwsh:latest
steps:
- shell: pwsh -v '. {0}'
run: ''