mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
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> (cherry picked from commit b52da6190c971733cdf3ffcef97cdbdce4ba42e5)
This commit is contained in:
parent
e489be545d
commit
4453e1a834
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
@ -96,10 +97,10 @@ func (w *Workflow) OnSchedule() []string {
|
||||||
func (w *Workflow) UnmarshalYAML(node *yaml.Node) error {
|
func (w *Workflow) UnmarshalYAML(node *yaml.Node) error {
|
||||||
// Validate the schema before deserializing it into our model
|
// Validate the schema before deserializing it into our model
|
||||||
if err := (&schema.Node{
|
if err := (&schema.Node{
|
||||||
Definition: "workflow-root-strict",
|
Definition: "workflow-root",
|
||||||
Schema: schema.GetWorkflowSchema(),
|
Schema: schema.GetWorkflowSchema(),
|
||||||
}).UnmarshalYAML(node); err != nil {
|
}).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
|
type WorkflowDefault Workflow
|
||||||
return node.Decode((*WorkflowDefault)(w))
|
return node.Decode((*WorkflowDefault)(w))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue