mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-08-08 22:05:03 +02: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:
committed by
appleboy
co-authored by
Lunny Xiao
parent
7c5400d75b
commit
3daf313205
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user