handle array type for on: in workflow file
This commit is contained in:
parent
a9bebff03f
commit
eb66ee9dfe
2 changed files with 12 additions and 0 deletions
|
|
@ -369,6 +369,13 @@ func findInputs(yamlContent []byte) (map[string]WorkflowInput, error) {
|
|||
dispatchKeyNode = node
|
||||
}
|
||||
}
|
||||
} else if node.Kind == yaml.SequenceNode {
|
||||
for _, node := range node.Content {
|
||||
if node.Value == "workflow_dispatch" {
|
||||
dispatchKeyNode = node
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if node.Kind == yaml.ScalarNode {
|
||||
if node.Value == "workflow_dispatch" {
|
||||
dispatchKeyNode = node
|
||||
|
|
|
|||
|
|
@ -246,6 +246,11 @@ func Test_findInputs(t *testing.T) {
|
|||
YAML: []byte("name: workflow\non: workflow_dispatch"),
|
||||
wantOut: map[string]WorkflowInput{},
|
||||
},
|
||||
{
|
||||
name: "array of events",
|
||||
YAML: []byte("name: workflow\non: [pull_request, workflow_dispatch]\n"),
|
||||
wantOut: map[string]WorkflowInput{},
|
||||
},
|
||||
{
|
||||
name: "inputs",
|
||||
YAML: []byte(`name: workflow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue