fix: return error if both run:
/uses:
keys are used (#593)
fixes https://github.com/nektos/act/issues/536
This commit is contained in:
@@ -87,6 +87,8 @@ func (sc *StepContext) Executor() common.Executor {
|
||||
sc.setupAction(actionDir, remoteAction.Path),
|
||||
sc.runAction(actionDir, remoteAction.Path),
|
||||
)
|
||||
case model.StepTypeInvalid:
|
||||
return common.NewErrorExecutor(fmt.Errorf("Invalid run/uses syntax for job:%s step:%+v", rc.Run, step))
|
||||
}
|
||||
|
||||
return common.NewErrorExecutor(fmt.Errorf("Unable to determine how to run job:%s step:%+v", rc.Run, step))
|
||||
|
@@ -12,10 +12,13 @@ func TestStepContextExecutor(t *testing.T) {
|
||||
"ubuntu-latest": "node:12.20.1-buster-slim",
|
||||
}
|
||||
tables := []TestJobFileInfo{
|
||||
{"testdata", "uses-and-run-in-one-step", "push", "Invalid run/uses syntax for job:test step:Test", platforms, "linux/amd64"},
|
||||
{"testdata", "uses-github-empty", "push", "Expected format {org}/{repo}[/path]@ref", platforms, "linux/amd64"},
|
||||
{"testdata", "uses-github-noref", "push", "Expected format {org}/{repo}[/path]@ref", platforms, "linux/amd64"},
|
||||
{"testdata", "uses-github-root", "push", "", platforms, "linux/amd64"},
|
||||
{"testdata", "uses-github-path", "push", "", platforms, "linux/amd64"},
|
||||
|
||||
{"testdata", "uses-and-run-in-one-step", "push", "Invalid run/uses syntax for job:test step:Test", platforms, "linux/arm64"},
|
||||
{"testdata", "uses-github-empty", "push", "Expected format {org}/{repo}[/path]@ref", platforms, "linux/arm64"},
|
||||
{"testdata", "uses-github-noref", "push", "Expected format {org}/{repo}[/path]@ref", platforms, "linux/arm64"},
|
||||
{"testdata", "uses-github-root", "push", "", platforms, "linux/arm64"},
|
||||
|
10
pkg/runner/testdata/uses-and-run-in-one-step/push.yml
vendored
Normal file
10
pkg/runner/testdata/uses-and-run-in-one-step/push.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
name: uses-and-run-in-one-step
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Test
|
||||
run: echo
|
||||
uses: actions/checkout@v2
|
Reference in New Issue
Block a user