fix: use non strict schema to allow some undefined behavior (#30)

* GitHub Actions doesn't use the newer strict schema in the service
* Tolerate more hallucinations

---------

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2025-01-29 17:20:06 +01:00
committed by GitHub
parent f28c532f35
commit 9d516e8fa2

View File

@@ -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))