From 62bbf3e05fe1dee54d5f15e85991907acf0fcfcf Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Thu, 7 Nov 2024 22:33:34 +0100 Subject: [PATCH 1/4] 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 --- pkg/model/workflow.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index 57e8f57dc61..804e920386a 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -70,10 +70,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)) From 4fed3395132d40b401684e9f037f6ece866e9cf1 Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Thu, 7 Nov 2024 22:49:28 +0100 Subject: [PATCH 2/4] Update workflow.go --- pkg/model/workflow.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index 804e920386a..6114594479e 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -1,6 +1,7 @@ package model import ( + "errors" "fmt" "io" "reflect" From b253c5d68956ebd91ad8efa769fdca2f5c16e244 Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Thu, 7 Nov 2024 22:53:16 +0100 Subject: [PATCH 3/4] Update workflow.go --- pkg/model/workflow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index 6114594479e..aa064f57f3e 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -74,7 +74,7 @@ func (w *Workflow) UnmarshalYAML(node *yaml.Node) error { Definition: "workflow-root", Schema: schema.GetWorkflowSchema(), }).UnmarshalYAML(node); err != nil { - return errors.join(err, fmt.Errorf("Actions YAML Schema Validation Error detected:\nFor more information, see https://nektosact.com/usage/schema.html.")) + 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)) From be575d3264975cf22bf76597725ffc910675b0cd Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Fri, 8 Nov 2024 06:44:15 +0100 Subject: [PATCH 4/4] Update pkg/model/workflow.go Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- pkg/model/workflow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index aa064f57f3e..54f6075817d 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -74,7 +74,7 @@ func (w *Workflow) UnmarshalYAML(node *yaml.Node) error { Definition: "workflow-root", Schema: schema.GetWorkflowSchema(), }).UnmarshalYAML(node); err != nil { - return errors.Join(err, fmt.Errorf("Actions YAML Schema Validation Error detected:\nFor more information, see https://nektosact.com/usage/schema.html.")) + 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))