mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-26 18:20:59 +00:00
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:
parent
665bd249ea
commit
06ef9ae6fe
8 changed files with 167 additions and 82 deletions
15
act/runner/testdata/shells/python/push.yml
vendored
15
act/runner/testdata/shells/python/push.yml
vendored
|
@ -1,9 +1,11 @@
|
|||
on: push
|
||||
env:
|
||||
MY_SHELL: python
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- shell: python
|
||||
- shell: ${{ env.MY_SHELL }}
|
||||
run: |
|
||||
import platform
|
||||
print(platform.python_version())
|
||||
|
@ -11,7 +13,16 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
container: node:12-buster
|
||||
steps:
|
||||
- shell: python
|
||||
- shell: ${{ env.MY_SHELL }}
|
||||
run: |
|
||||
import platform
|
||||
print(platform.python_version())
|
||||
check-job-default:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: ${{ env.MY_SHELL }}
|
||||
steps:
|
||||
- run: |
|
||||
import platform
|
||||
print(platform.python_version())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue