@@ -319,7 +319,7 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R
319319 os .Unsetenv ("INPUT_GITHUB_TOKEN" )
320320 os .Unsetenv ("INPUT_TOKEN" )
321321
322- ag , errs := LoadGraph (graphYaml , nil , "" , nil , opts )
322+ ag , errs := LoadGraph (graphYaml , nil , "" , opts )
323323 if len (errs ) > 0 {
324324 return CreateErr (nil , errs [0 ], "failed to load graph" )
325325 }
@@ -580,9 +580,9 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R
580580 return mainErr
581581}
582582
583- func LoadGraph (graphYaml map [string ]any , parent NodeBaseInterface , parentId string , vs * ValidationState , opts RunOpts ) (ActionGraph , []error ) {
583+ func LoadGraph (graphYaml map [string ]any , parent NodeBaseInterface , parentId string , opts RunOpts ) (ActionGraph , []error ) {
584584
585- opts . VS = vs
585+ vs := opts . VS
586586 ag := NewActionGraph ()
587587
588588 var err error
@@ -601,7 +601,7 @@ func LoadGraph(graphYaml map[string]any, parent NodeBaseInterface, parentId stri
601601 }
602602 }
603603
604- err = LoadNodes (& ag , parent , parentId , graphYaml , vs , opts )
604+ err = LoadNodes (& ag , parent , parentId , graphYaml , opts )
605605 if err != nil && vs == nil {
606606 return ActionGraph {}, []error {err }
607607 }
@@ -682,14 +682,14 @@ func anyToPortDefinition[T any](o any) (T, error) {
682682 return ret , err
683683}
684684
685- func LoadNodes (ag * ActionGraph , parent NodeBaseInterface , parentId string , nodesYaml map [string ]any , vs * ValidationState , opts RunOpts ) error {
685+ func LoadNodes (ag * ActionGraph , parent NodeBaseInterface , parentId string , nodesYaml map [string ]any , opts RunOpts ) error {
686686 nodesList , err := utils .GetTypedPropertyByPath [[]any ](nodesYaml , "nodes" )
687687 if err != nil {
688- return collectOrReturn (err , vs )
688+ return collectOrReturn (err , opts . VS )
689689 }
690690
691691 for _ , nodeData := range nodesList {
692- n , id , err := LoadNode (parent , parentId , nodeData , vs , opts )
692+ n , id , err := LoadNode (parent , parentId , nodeData , opts )
693693 if err != nil {
694694 return err
695695 }
@@ -704,7 +704,8 @@ func LoadNodes(ag *ActionGraph, parent NodeBaseInterface, parentId string, nodes
704704 return nil
705705}
706706
707- func LoadNode (parent NodeBaseInterface , parentId string , nodeData any , vs * ValidationState , opts RunOpts ) (NodeBaseInterface , string , error ) {
707+ func LoadNode (parent NodeBaseInterface , parentId string , nodeData any , opts RunOpts ) (NodeBaseInterface , string , error ) {
708+ vs := opts .VS
708709 nodeI , ok := nodeData .(map [string ]any )
709710 if ! ok {
710711 err := CreateErr (nil , nil , "node is not a map" )
0 commit comments