chore(yaml): Improve ParseRawOn
(#28)
See [act_runner #71 comment](https://gitea.com/gitea/act_runner/issues/71#issuecomment-733806), we need to handle `nil interface{}` in `ParseRawOn` function Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-on: https://gitea.com/gitea/act/pulls/28 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: appleboy <appleboy.tw@gmail.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
parent
7c5400d75b
commit
3daf313205
1 changed files with 7 additions and 0 deletions
|
@ -177,6 +177,13 @@ func ParseRawOn(rawOn *yaml.Node) ([]*Event, error) {
|
|||
}
|
||||
res := make([]*Event, 0, len(val))
|
||||
for k, v := range val {
|
||||
if v == nil {
|
||||
res = append(res, &Event{
|
||||
Name: k,
|
||||
Acts: map[string][]string{},
|
||||
})
|
||||
continue
|
||||
}
|
||||
switch t := v.(type) {
|
||||
case string:
|
||||
res = append(res, &Event{
|
||||
|
|
Loading…
Reference in a new issue