mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-12 19:03:45 +00:00
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 <[email protected]> Reviewed-on: https://gitea.com/gitea/act/pulls/28 Reviewed-by: Lunny Xiao <[email protected]> Reviewed-by: appleboy <[email protected]> Co-authored-by: Zettat123 <[email protected]> Co-committed-by: Zettat123 <[email protected]>
This commit is contained in:
1 parent
7c5400d75b
commit
3daf313205
1 file changed
+7
@@ -177,6 +177,13 @@ func ParseRawOn(rawOn *yaml.Node) ([]*Event, error) {
|
|||||||
}
|
}
|
||||||
res := make([]*Event, 0, len(val))
|
res := make([]*Event, 0, len(val))
|
||||||
for k, v := range val {
|
for k, v := range val {
|
||||||
|
if v == nil {
|
||||||
|
res = append(res, &Event{
|
||||||
|
Name: k,
|
||||||
|
Acts: map[string][]string{},
|
||||||
|
})
|
||||||
|
continue
|
||||||
|
}
|
||||||
switch t := v.(type) {
|
switch t := v.(type) {
|
||||||
case string:
|
case string:
|
||||||
res = append(res, &Event{
|
res = append(res, &Event{
|
||||||
|
|||||||
Reference in new issue
Block a user