parent
d2d5c90a36
commit
b670173764
4 changed files with 24 additions and 0 deletions
|
@ -53,6 +53,7 @@ func TestRunEvent(t *testing.T) {
|
|||
{"local-action-dockerfile", "push", ""},
|
||||
{"matrix", "push", ""},
|
||||
{"commands", "push", ""},
|
||||
{"workdir", "push", ""},
|
||||
}
|
||||
log.SetLevel(log.DebugLevel)
|
||||
|
||||
|
|
|
@ -110,6 +110,13 @@ func (sc *StepContext) setupShellCommand() common.Executor {
|
|||
return err
|
||||
}
|
||||
|
||||
if step.WorkingDirectory != "" {
|
||||
_, err = script.WriteString(fmt.Sprintf("cd %s\n", step.WorkingDirectory))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
run := rc.ExprEval.Interpolate(step.Run)
|
||||
|
||||
if _, err = script.WriteString(run); err != nil {
|
||||
|
|
0
pkg/runner/testdata/workdir/canary
vendored
Normal file
0
pkg/runner/testdata/workdir/canary
vendored
Normal file
16
pkg/runner/testdata/workdir/push.yml
vendored
Normal file
16
pkg/runner/testdata/workdir/push.yml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
name: workdir
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
workdir:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: '[[ "$(pwd)" == "/github/workspace/workdir" ]]'
|
||||
working-directory: workdir
|
||||
|
||||
noworkdir:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: '[[ "$(pwd)" == "/github/workspace" ]]'
|
Loading…
Reference in a new issue