From cf09fd0af1db7b2c2ed4e58c25860dc75295d274 Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Tue, 25 Feb 2025 03:45:49 +0100 Subject: [PATCH] fix: use non strict schema to allow some undefined behavior (#2524) * fix: use non strict schema to allow some undefined behavior * GitHub Actions doesn't use the newer strict schema in the service * Tolerate more hallucinations * Update workflow.go * Update workflow.go * Update pkg/model/workflow.go Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --------- Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- pkg/model/workflow.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index d67ce41..f8eee0a 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -1,6 +1,7 @@ package model import ( + "errors" "fmt" "io" "reflect" @@ -70,10 +71,10 @@ func (w *Workflow) OnEvent(event string) interface{} { func (w *Workflow) UnmarshalYAML(node *yaml.Node) error { // Validate the schema before deserializing it into our model if err := (&schema.Node{ - Definition: "workflow-root-strict", + Definition: "workflow-root", Schema: schema.GetWorkflowSchema(), }).UnmarshalYAML(node); err != nil { - return err + return errors.Join(err, fmt.Errorf("Actions YAML Schema Validation Error detected:\nFor more information, see: https://nektosact.com/usage/schema.html")) } type WorkflowDefault Workflow return node.Decode((*WorkflowDefault)(w))