Merge pull request 'fix(jobparser): support workflow_dispatch.inputs
' (#45) from viceice/fix-inputs into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/45 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
This commit is contained in:
commit
1835203108
2 changed files with 13 additions and 0 deletions
|
@ -259,6 +259,11 @@ func ParseRawOn(rawOn *yaml.Node) ([]*Event, error) {
|
||||||
return nil, fmt.Errorf("unknown on type: %#v", branches)
|
return nil, fmt.Errorf("unknown on type: %#v", branches)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case map[string]interface{}:
|
||||||
|
if k != "workflow_dispatch" || act != "inputs" {
|
||||||
|
return nil, fmt.Errorf("unknown on type: %#v", v)
|
||||||
|
}
|
||||||
|
acts = nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unknown on type: %#v", branches)
|
return nil, fmt.Errorf("unknown on type: %#v", branches)
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,6 +186,14 @@ func TestParseRawOn(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
input: "on:\n workflow_dispatch:\n inputs:\n test:\n type: string",
|
||||||
|
result: []*Event{
|
||||||
|
{
|
||||||
|
Name: "workflow_dispatch",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, kase := range kases {
|
for _, kase := range kases {
|
||||||
t.Run(kase.input, func(t *testing.T) {
|
t.Run(kase.input, func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue