diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/actions/workflows.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/actions/workflows.go b/modules/actions/workflows.go index 76c144bb2b..d30982a46b 100644 --- a/modules/actions/workflows.go +++ b/modules/actions/workflows.go @@ -17,8 +17,18 @@ import ( "github.com/nektos/act/pkg/jobparser" "github.com/nektos/act/pkg/model" "github.com/nektos/act/pkg/workflowpattern" + "gopkg.in/yaml.v3" ) +func init() { + model.OnDecodeNodeError = func(node yaml.Node, out interface{}, err error) { + // Log the error instead of panic or fatal. + // It will be a big job to refactor act/pkg/model to return decode error, + // so we just log the error and return empty value, and improve it later. + log.Error("Failed to decode node %v into %T: %v", node, out, err) + } +} + func ListWorkflows(commit *git.Commit) (git.Entries, error) { tree, err := commit.SubTree(".gitea/workflows") if _, ok := err.(git.ErrNotExist); ok { |