mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-20 11:56:47 +08:00
Replace expressions engine (#133)
This commit is contained in:
@@ -69,6 +69,9 @@ func (w *Workflow) OnEvent(event string) interface{} {
|
||||
}
|
||||
|
||||
func (w *Workflow) UnmarshalYAML(node *yaml.Node) error {
|
||||
if err := resolveAliases(node); err != nil {
|
||||
return err
|
||||
}
|
||||
// Validate the schema before deserializing it into our model
|
||||
if err := (&schema.Node{
|
||||
Definition: "workflow-root",
|
||||
@@ -76,9 +79,6 @@ func (w *Workflow) UnmarshalYAML(node *yaml.Node) error {
|
||||
}).UnmarshalYAML(node); err != nil {
|
||||
return errors.Join(err, fmt.Errorf("actions YAML Schema Validation Error detected:\nFor more information, see: https://actions-oss.github.io/act-docs/usage/schema.html"))
|
||||
}
|
||||
if err := resolveAliases(node); err != nil {
|
||||
return err
|
||||
}
|
||||
type WorkflowDefault Workflow
|
||||
return node.Decode((*WorkflowDefault)(w))
|
||||
}
|
||||
@@ -86,6 +86,9 @@ func (w *Workflow) UnmarshalYAML(node *yaml.Node) error {
|
||||
type WorkflowStrict Workflow
|
||||
|
||||
func (w *WorkflowStrict) UnmarshalYAML(node *yaml.Node) error {
|
||||
if err := resolveAliases(node); err != nil {
|
||||
return err
|
||||
}
|
||||
// Validate the schema before deserializing it into our model
|
||||
if err := (&schema.Node{
|
||||
Definition: "workflow-root-strict",
|
||||
@@ -93,9 +96,6 @@ func (w *WorkflowStrict) UnmarshalYAML(node *yaml.Node) error {
|
||||
}).UnmarshalYAML(node); err != nil {
|
||||
return errors.Join(err, fmt.Errorf("actions YAML Strict Schema Validation Error detected:\nFor more information, see: https://nektosact.com/usage/schema.html"))
|
||||
}
|
||||
if err := resolveAliases(node); err != nil {
|
||||
return err
|
||||
}
|
||||
type WorkflowDefault Workflow
|
||||
return node.Decode((*WorkflowDefault)(w))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user