From 70894d73c017dabb81d51ccd41f3509ad9bde53c Mon Sep 17 00:00:00 2001 From: Sebatian Rath Date: Thu, 29 Jan 2026 23:22:25 -0500 Subject: [PATCH 1/3] Pass RunOpts through node factory functions and improve GitHub environment detection --- cmd/cmd_validate.go | 2 +- core/base.go | 10 ++--- core/graph.go | 61 ++++++++++++++++++---------- nodes/affirm@v1.go | 2 +- nodes/array-add@v1.go | 2 +- nodes/array-append@v1.go | 2 +- nodes/array-get@v1.go | 2 +- nodes/bool@v1.go | 2 +- nodes/branch@v1.go | 2 +- nodes/comment@v1.go | 2 +- nodes/concurrent-exec@v1.go | 2 +- nodes/concurrent-for-each-loop@v1.go | 2 +- nodes/concurrent-for-loop@v1.go | 2 +- nodes/const@v1.go | 6 +-- nodes/credentials-accesskey@v1.go | 2 +- nodes/credentials-ssh@v1.go | 2 +- nodes/credentials-userpass@v1.go | 2 +- nodes/dir-create@v1.go | 2 +- nodes/dir-walk@v1.go | 2 +- nodes/env-array@v1.go | 2 +- nodes/env-get@v1.go | 2 +- nodes/file-compress@v1.go | 2 +- nodes/file-read@v1.go | 2 +- nodes/file-write@v1.go | 2 +- nodes/filepath-join-array@v1.go | 2 +- nodes/filepath-join@v1.go | 2 +- nodes/filepath-location@v1.go | 2 +- nodes/filepath-op@v1.go | 2 +- nodes/filepath-rel@v1.go | 2 +- nodes/filepath-sort@v1.go | 2 +- nodes/for-each-loop@v1.go | 2 +- nodes/for-loop@v1.go | 2 +- nodes/freeze@v1.go | 2 +- nodes/gh-start@v1.go | 2 +- nodes/git-checkout@v1.go | 2 +- nodes/git-clone@v1.go | 2 +- nodes/git-commit@v1.go | 2 +- nodes/git-pull@v1.go | 2 +- nodes/git-push@v1.go | 2 +- nodes/git-stage@v1.go | 2 +- nodes/group-inputs@v1.go | 2 +- nodes/group-outputs@v1.go | 2 +- nodes/group@v1.go | 4 +- nodes/hash@v1.go | 2 +- nodes/http@v1.go | 2 +- nodes/item-stats@v1.go | 2 +- nodes/length@v1.go | 2 +- nodes/llm-prompt@v1.go | 2 +- nodes/math-compare-op@v1.go | 2 +- nodes/math-compare@v1.go | 2 +- nodes/math-op@v1.go | 2 +- nodes/math@v1.go | 2 +- nodes/negate@v1.go | 2 +- nodes/nrun-python-embedded@v1.go | 2 +- nodes/number-array@v1.go | 2 +- nodes/parser@v1.go | 2 +- nodes/print@v1.go | 2 +- nodes/process-exit@v1.go | 2 +- nodes/property-getter@v1.go | 2 +- nodes/property-setter@v1.go | 2 +- nodes/random-number@v1.go | 2 +- nodes/random-stream@v1.go | 2 +- nodes/run-exec@v1.go | 2 +- nodes/run-python-embedded@v1.go | 2 +- nodes/run@v1.go | 2 +- nodes/secret-get@v1.go | 2 +- nodes/secret-set@v1.go | 2 +- nodes/select-data@v1.go | 2 +- nodes/select-exec@v1.go | 2 +- nodes/sequence@v1.go | 2 +- nodes/serializer@v1.go | 2 +- nodes/sleep@v1.go | 2 +- nodes/start@v1.go | 2 +- nodes/storage-delete@v1.go | 2 +- nodes/storage-download@v1.go | 2 +- nodes/storage-provider-s3@v1.go | 2 +- nodes/storage-upload@v1.go | 2 +- nodes/storage-walk@v1.go | 2 +- nodes/stream-cache@v1.go | 2 +- nodes/string-array@v1.go | 2 +- nodes/string-decode@v1.go | 2 +- nodes/string-encode@v1.go | 2 +- nodes/string-fmt@v1.go | 2 +- nodes/string-join-array@v1.go | 2 +- nodes/string-join@v1.go | 2 +- nodes/string-match-regex@v1.go | 2 +- nodes/string-match@v1.go | 2 +- nodes/string-replace@v1.go | 2 +- nodes/string-split@v1.go | 2 +- nodes/string-transform@v1.go | 2 +- nodes/switch-arch@v1.go | 2 +- nodes/switch-platform@v1.go | 2 +- nodes/system-info@v1.go | 2 +- nodes/test@v1.go | 2 +- nodes/test@v1_test.go | 6 +-- nodes/wait-for@v1.go | 2 +- tests_unit/core_test.go | 2 +- 97 files changed, 144 insertions(+), 127 deletions(-) diff --git a/cmd/cmd_validate.go b/cmd/cmd_validate.go index 60b79de..1fae746 100644 --- a/cmd/cmd_validate.go +++ b/cmd/cmd_validate.go @@ -54,7 +54,7 @@ func validateGraph(filePath string) error { return err } - _, errs := core.LoadGraph(graphYaml, nil, "", true) + _, errs := core.LoadGraph(graphYaml, nil, "", true, core.RunOpts{}) if len(errs) > 0 { fmt.Printf("\n❌ Validation failed with %d error(s):\n", len(errs)) diff --git a/core/base.go b/core/base.go index 410e27b..df52d40 100644 --- a/core/base.go +++ b/core/base.go @@ -287,7 +287,7 @@ func LogDebugInfoForGh(t GetNameIdInterface) { ) } -type nodeFactoryFunc func(ctx any, parent NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (NodeBaseInterface, []error) +type nodeFactoryFunc func(ctx any, parent NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts RunOpts) (NodeBaseInterface, []error) var registries = make(map[string]NodeTypeDefinitionFull) @@ -585,13 +585,13 @@ func RegisterNodeFactory(nodeDefStr string, fn nodeFactoryFunc) error { return nil } -func NewGhActionNode(nodeType string, parent NodeBaseInterface, parentId string, validate bool) (NodeBaseInterface, []error) { +func NewGhActionNode(nodeType string, parent NodeBaseInterface, parentId string, validate bool, opts RunOpts) (NodeBaseInterface, []error) { factoryEntry, exists := registries["core/gh-action@v1"] if !exists { return nil, []error{CreateErr(nil, nil, "node type '%v' not registered", nodeType)} } - node, errs := factoryEntry.FactoryFn(nodeType, parent, parentId, nil, validate) + node, errs := factoryEntry.FactoryFn(nodeType, parent, parentId, nil, validate, opts) if len(errs) > 0 { return nil, errs } @@ -601,7 +601,7 @@ func NewGhActionNode(nodeType string, parent NodeBaseInterface, parentId string, return node, nil } -func NewNodeInstance(nodeType string, parent NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (NodeBaseInterface, []error) { +func NewNodeInstance(nodeType string, parent NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts RunOpts) (NodeBaseInterface, []error) { var ( node NodeBaseInterface errs []error @@ -616,7 +616,7 @@ func NewNodeInstance(nodeType string, parent NodeBaseInterface, parentId string, factoryEntry, exists := registries[nodeType] if exists { // Pass 'validate' to the factory function - node, errs = factoryEntry.FactoryFn(nil, parent, parentId, nodeDef, validate) + node, errs = factoryEntry.FactoryFn(nil, parent, parentId, nodeDef, validate, opts) if len(errs) > 0 { // If the factory failed to produce a node (or found errors), return them. return nil, errs diff --git a/core/graph.go b/core/graph.go index 0d06bf9..c970114 100644 --- a/core/graph.go +++ b/core/graph.go @@ -276,7 +276,7 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R return CreateErr(nil, err, "failed to load yaml") } - ag, errs := LoadGraph(graphYaml, nil, "", false) + ag, errs := LoadGraph(graphYaml, nil, "", false, opts) if len(errs) > 0 { return CreateErr(nil, errs[0], "failed to load graph") } @@ -287,8 +287,23 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R } entryNode, isBaseNode := entry.(NodeBaseInterface) - isGitHubAction := os.Getenv("GITHUB_ACTIONS") == "true" - isGitHubWorkflow := isBaseNode && entryNode.GetNodeTypeId() == "core/gh-start@v1" + + // isGitHubActions: Determines if this run should behave as a GitHub Action. + // True when either running on actual GitHub Actions (system env), or an external + // caller (e.g., web app) explicitly requests GitHub Actions behavior via OverrideEnv. + // This affects input variable handling, context loading, and other GitHub-specific behavior. + // + // **Important** we haven't loaded the config file yet, so we can only look at overriden envs, + // .env (already set in os.GetEnv) or shell. + isGitHubActions := opts.OverrideEnv["GITHUB_ACTIONS"] == "true" || os.Getenv("GITHUB_ACTIONS") == "true" || entryNode.GetNodeTypeId() == "core/gh-start@v1" + + // mimickGitHubEnv: Determines if we need to set up a simulated GitHub environment. The easiest + // approach for now is to just check a bunch of env vars. The user may have set one or the other + // (through .env or shell) but unlikely all of them but they are by a real GitHub Actions runner. + mimickGitHubEnv := isGitHubActions && os.Getenv("GITHUB_RUN_ID") == "" && + os.Getenv("RUNNER_TEMP") == "" && + os.Getenv("GITHUB_API_URL") == "" && + os.Getenv("GITHUB_RETENTION_DAYS") == "" // Initialize trackers with their respective categories envTracker := newValueMap[string]("env") @@ -301,19 +316,21 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R if opts.ConfigFile != "" { if _, err := os.Stat(opts.ConfigFile); err == nil { localConfig, err := utils.LoadConfig(opts.ConfigFile) - if err == nil { - configName := filepath.Base(opts.ConfigFile) - envTracker.set(localConfig.Env, configName, true, false) - inputTracker.set(localConfig.Inputs, configName, true, false) - secretTracker.set(localConfig.Secrets, configName, true, true) + if err != nil { + return CreateErr(nil, err, "failed to load config file") } + + configName := filepath.Base(opts.ConfigFile) + envTracker.set(localConfig.Env, configName, true, false) + inputTracker.set(localConfig.Inputs, configName, true, false) + secretTracker.set(localConfig.Secrets, configName, true, true) } } rawEnv := utils.GetAllEnvMapCopy() // normalize all inputs/secrets with ACT_* iif we're in GitHub - if isGitHubWorkflow { + if isGitHubActions { prefixedRawEnv := make(map[string]utils.EnvKV) for k, v := range rawEnv { prefixedKey := k @@ -366,15 +383,15 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R secretTracker.setSingle(key, v.Value, fmt.Sprintf("%s (%s)", source, k), true, true) // GitHub specifics - case isGitHubWorkflow && k == "ACT_INPUT_MATRIX": + case isGitHubActions && k == "ACT_INPUT_MATRIX": if m, err := decodeJsonFromEnvValue[any](v.Value); err == nil { matrixTracker.set(m, source, true, true) } - case isGitHubWorkflow && k == "ACT_INPUT_NEEDS": + case isGitHubActions && k == "ACT_INPUT_NEEDS": if m, err := decodeJsonFromEnvValue[any](v.Value); err == nil { needsTracker.set(m, source, true, true) } - case isGitHubWorkflow && k == "ACT_INPUT_TOKEN": + case isGitHubActions && k == "ACT_INPUT_TOKEN": secretTracker.setSingle("GITHUB_TOKEN", v.Value, source, true, true) default: @@ -413,7 +430,7 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R }() } - if !isGitHubAction && isGitHubWorkflow { + if mimickGitHubEnv { // If we are running a github actions workflow, then mimic a GitHub Actions environment // But only do is if we are NOT already in GitHub Actions err = SetupGitHubActionsEnv(finalEnv) @@ -439,7 +456,7 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R // construct the `github` context var ghContext map[string]any var errGh error - if isGitHubWorkflow { + if isGitHubActions { ghContext, errGh = LoadGitHubContext(finalEnv, finalInputs, finalSecrets) if errGh != nil { return CreateErr(nil, errGh, "failed to load github context") @@ -450,7 +467,7 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R ctx, &ag, graphName, - isGitHubWorkflow, + isGitHubActions, debugCb, finalEnv, finalInputs, @@ -467,7 +484,7 @@ func RunGraph(ctx context.Context, graphName string, graphContent []byte, opts R return entry.ExecuteEntry(c, nil, opts.Args) } -func LoadGraph(graphYaml map[string]any, parent NodeBaseInterface, parentId string, validate bool) (ActionGraph, []error) { +func LoadGraph(graphYaml map[string]any, parent NodeBaseInterface, parentId string, validate bool, opts RunOpts) (ActionGraph, []error) { var ( collectedErrors []error @@ -492,7 +509,7 @@ func LoadGraph(graphYaml map[string]any, parent NodeBaseInterface, parentId stri collectedErrors = append(collectedErrors, err) } - err = LoadNodes(&ag, parent, parentId, graphYaml, validate, &collectedErrors) + err = LoadNodes(&ag, parent, parentId, graphYaml, validate, &collectedErrors, opts) if err != nil && !validate { return ActionGraph{}, []error{err} } @@ -570,14 +587,14 @@ func anyToPortDefinition[T any](o any) (T, error) { return ret, err } -func LoadNodes(ag *ActionGraph, parent NodeBaseInterface, parentId string, nodesYaml map[string]any, validate bool, errs *[]error) error { +func LoadNodes(ag *ActionGraph, parent NodeBaseInterface, parentId string, nodesYaml map[string]any, validate bool, errs *[]error, opts RunOpts) error { nodesList, err := utils.GetTypedPropertyByPath[[]any](nodesYaml, "nodes") if err != nil { return collectOrReturn(err, validate, errs) } for _, nodeData := range nodesList { - n, id, err := LoadNode(parent, parentId, nodeData, validate, errs) + n, id, err := LoadNode(parent, parentId, nodeData, validate, errs, opts) if err != nil { return err } @@ -592,7 +609,7 @@ func LoadNodes(ag *ActionGraph, parent NodeBaseInterface, parentId string, nodes return nil } -func LoadNode(parent NodeBaseInterface, parentId string, nodeData any, validate bool, errs *[]error) (NodeBaseInterface, string, error) { +func LoadNode(parent NodeBaseInterface, parentId string, nodeData any, validate bool, errs *[]error, opts RunOpts) (NodeBaseInterface, string, error) { nodeI, ok := nodeData.(map[string]any) if !ok { err := CreateErr(nil, nil, "node is not a map") @@ -635,9 +652,9 @@ func LoadNode(parent NodeBaseInterface, parentId string, nodeData any, validate fullPath = parentId + "/" + id } if strings.HasPrefix(nodeType, "github.com/") { - n, factoryErrs = NewGhActionNode(nodeType, parent, fullPath, validate) + n, factoryErrs = NewGhActionNode(nodeType, parent, fullPath, validate, opts) } else { - n, factoryErrs = NewNodeInstance(nodeType, parent, fullPath, nodeI, validate) + n, factoryErrs = NewNodeInstance(nodeType, parent, fullPath, nodeI, validate, opts) } if len(factoryErrs) > 0 { diff --git a/nodes/affirm@v1.go b/nodes/affirm@v1.go index 825f094..773c343 100644 --- a/nodes/affirm@v1.go +++ b/nodes/affirm@v1.go @@ -26,7 +26,7 @@ func (n *AffirmNode) OutputValueById(c *core.ExecutionState, outputId core.Outpu } func init() { - err := core.RegisterNodeFactory(affirmDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(affirmDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &AffirmNode{}, nil }) if err != nil { diff --git a/nodes/array-add@v1.go b/nodes/array-add@v1.go index 31ae237..e66542c 100644 --- a/nodes/array-add@v1.go +++ b/nodes/array-add@v1.go @@ -60,7 +60,7 @@ func (n *ArrayAddNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(arrayAddNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(arrayAddNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ArrayAddNode{}, nil }) if err != nil { diff --git a/nodes/array-append@v1.go b/nodes/array-append@v1.go index b3a5f92..45cac1d 100644 --- a/nodes/array-append@v1.go +++ b/nodes/array-append@v1.go @@ -51,7 +51,7 @@ func (n *ArrayAppendNode) ExecuteImpl(c *core.ExecutionState, inputId core.Input } func init() { - err := core.RegisterNodeFactory(arrayAppendNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(arrayAppendNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ArrayAppendNode{}, nil }) if err != nil { diff --git a/nodes/array-get@v1.go b/nodes/array-get@v1.go index f428fcc..a93ad22 100644 --- a/nodes/array-get@v1.go +++ b/nodes/array-get@v1.go @@ -51,7 +51,7 @@ func (n *ArrayGet) OutputValueById(c *core.ExecutionState, outputId core.OutputI } func init() { - err := core.RegisterNodeFactory(arrayGetDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(arrayGetDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ArrayGet{}, nil }) if err != nil { diff --git a/nodes/bool@v1.go b/nodes/bool@v1.go index 358e6ce..663be3e 100644 --- a/nodes/bool@v1.go +++ b/nodes/bool@v1.go @@ -84,7 +84,7 @@ func init() { } for _, op := range ops { - err := core.RegisterNodeFactory(op.definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(op.definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &BoolNode{ op: op.op, opStr: op.opStr, diff --git a/nodes/branch@v1.go b/nodes/branch@v1.go index a2a9e26..bfb7625 100644 --- a/nodes/branch@v1.go +++ b/nodes/branch@v1.go @@ -38,7 +38,7 @@ func (n *BranchNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, p } func init() { - err := core.RegisterNodeFactory(ifDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(ifDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &BranchNode{}, nil }) if err != nil { diff --git a/nodes/comment@v1.go b/nodes/comment@v1.go index 72a07ab..3e50f51 100644 --- a/nodes/comment@v1.go +++ b/nodes/comment@v1.go @@ -15,7 +15,7 @@ type CommentNode struct { } func init() { - err := core.RegisterNodeFactory(commentNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(commentNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &CommentNode{}, nil }) if err != nil { diff --git a/nodes/concurrent-exec@v1.go b/nodes/concurrent-exec@v1.go index d050f7e..825b598 100644 --- a/nodes/concurrent-exec@v1.go +++ b/nodes/concurrent-exec@v1.go @@ -79,7 +79,7 @@ func (n *ConcurrentExecNode) ExecuteImpl(c *core.ExecutionState, inputId core.In } func init() { - err := core.RegisterNodeFactory(concurrentExecDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(concurrentExecDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ConcurrentExecNode{}, nil }) if err != nil { diff --git a/nodes/concurrent-for-each-loop@v1.go b/nodes/concurrent-for-each-loop@v1.go index 8fbaaab..d5508c9 100644 --- a/nodes/concurrent-for-each-loop@v1.go +++ b/nodes/concurrent-for-each-loop@v1.go @@ -128,7 +128,7 @@ func (n *ConcurrentForEachLoopNode) ExecuteImpl(c *core.ExecutionState, inputId } func init() { - err := core.RegisterNodeFactory(concurrentForEachLoopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(concurrentForEachLoopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ConcurrentForEachLoopNode{}, nil }) if err != nil { diff --git a/nodes/concurrent-for-loop@v1.go b/nodes/concurrent-for-loop@v1.go index 5529816..edc0c79 100644 --- a/nodes/concurrent-for-loop@v1.go +++ b/nodes/concurrent-for-loop@v1.go @@ -139,7 +139,7 @@ func (n *ConcurrentLoopNode) ExecuteImpl(c *core.ExecutionState, inputId core.In } func init() { - err := core.RegisterNodeFactory(concurrentForLoopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(concurrentForLoopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ConcurrentLoopNode{}, nil }) if err != nil { diff --git a/nodes/const@v1.go b/nodes/const@v1.go index a2e891f..7f85c46 100644 --- a/nodes/const@v1.go +++ b/nodes/const@v1.go @@ -33,7 +33,7 @@ func (n *ConstNode[T]) OutputValueById(c *core.ExecutionState, outputId core.Out } func init() { - err := core.RegisterNodeFactory(constStringDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(constStringDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ConstNode[string]{ portValue: ni.Core_const_string_v1_Input_value, }, nil @@ -42,7 +42,7 @@ func init() { panic(err) } - err = core.RegisterNodeFactory(constNumberDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err = core.RegisterNodeFactory(constNumberDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ConstNode[int64]{ portValue: ni.Core_const_number_v1_Input_value, }, nil @@ -51,7 +51,7 @@ func init() { panic(err) } - err = core.RegisterNodeFactory(constBoolDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err = core.RegisterNodeFactory(constBoolDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ConstNode[bool]{ portValue: ni.Core_const_bool_v1_Input_value, }, nil diff --git a/nodes/credentials-accesskey@v1.go b/nodes/credentials-accesskey@v1.go index 5d84405..6894398 100644 --- a/nodes/credentials-accesskey@v1.go +++ b/nodes/credentials-accesskey@v1.go @@ -40,7 +40,7 @@ func (n *AccessKeyCredentialsNode) OutputValueById(c *core.ExecutionState, outpu } func init() { - err := core.RegisterNodeFactory(accessKeyCredentialDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(accessKeyCredentialDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &AccessKeyCredentialsNode{}, nil }) if err != nil { diff --git a/nodes/credentials-ssh@v1.go b/nodes/credentials-ssh@v1.go index 18ca6d6..86b6c93 100644 --- a/nodes/credentials-ssh@v1.go +++ b/nodes/credentials-ssh@v1.go @@ -73,7 +73,7 @@ func (n *SshCredentialNode) OutputValueById(c *core.ExecutionState, outputId cor } func init() { - err := core.RegisterNodeFactory(sshCredentialDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(sshCredentialDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SshCredentialNode{}, nil }) if err != nil { diff --git a/nodes/credentials-userpass@v1.go b/nodes/credentials-userpass@v1.go index c185cd9..6073c68 100644 --- a/nodes/credentials-userpass@v1.go +++ b/nodes/credentials-userpass@v1.go @@ -40,7 +40,7 @@ func (n *UserPassCredentialsNode) OutputValueById(c *core.ExecutionState, output } func init() { - err := core.RegisterNodeFactory(userPassCredentialDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(userPassCredentialDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &UserPassCredentialsNode{}, nil }) if err != nil { diff --git a/nodes/dir-create@v1.go b/nodes/dir-create@v1.go index 67c504f..ba3f16c 100644 --- a/nodes/dir-create@v1.go +++ b/nodes/dir-create@v1.go @@ -45,7 +45,7 @@ func (n *DirCreateNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId } func init() { - err := core.RegisterNodeFactory(dirCreateDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(dirCreateDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &DirCreateNode{}, nil }) if err != nil { diff --git a/nodes/dir-walk@v1.go b/nodes/dir-walk@v1.go index 250ed2f..52f8f97 100644 --- a/nodes/dir-walk@v1.go +++ b/nodes/dir-walk@v1.go @@ -177,7 +177,7 @@ func walk(root string, opts walkOpts, pattern []string, items map[string]os.File } func init() { - err := core.RegisterNodeFactory(walkDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(walkDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &WalkNode{}, nil }) if err != nil { diff --git a/nodes/env-array@v1.go b/nodes/env-array@v1.go index ed52676..d5416a8 100644 --- a/nodes/env-array@v1.go +++ b/nodes/env-array@v1.go @@ -50,7 +50,7 @@ func (n *EnvArrayNode) OutputValueById(c *core.ExecutionState, outputId core.Out } func init() { - err := core.RegisterNodeFactory(envArrayDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(envArrayDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &EnvArrayNode{}, nil }) if err != nil { diff --git a/nodes/env-get@v1.go b/nodes/env-get@v1.go index 7a2b93e..b982559 100644 --- a/nodes/env-get@v1.go +++ b/nodes/env-get@v1.go @@ -29,7 +29,7 @@ func (n *EnvGetNode) OutputValueById(c *core.ExecutionState, outputId core.Outpu } func init() { - err := core.RegisterNodeFactory(envGetDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(envGetDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &EnvGetNode{}, nil }) if err != nil { diff --git a/nodes/file-compress@v1.go b/nodes/file-compress@v1.go index 66a05f6..d0cab9a 100644 --- a/nodes/file-compress@v1.go +++ b/nodes/file-compress@v1.go @@ -89,7 +89,7 @@ func (n *FileZipNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(fileZipDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(fileZipDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FileZipNode{}, nil }) if err != nil { diff --git a/nodes/file-read@v1.go b/nodes/file-read@v1.go index a86660a..ba5fdc3 100644 --- a/nodes/file-read@v1.go +++ b/nodes/file-read@v1.go @@ -70,7 +70,7 @@ func (n *FileReadNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(fileReadDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(fileReadDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FileReadNode{}, nil }) if err != nil { diff --git a/nodes/file-write@v1.go b/nodes/file-write@v1.go index ee422ec..86b088a 100644 --- a/nodes/file-write@v1.go +++ b/nodes/file-write@v1.go @@ -67,7 +67,7 @@ func (n *FileWriteNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId } func init() { - err := core.RegisterNodeFactory(fileWriteDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(fileWriteDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FileWriteNode{}, nil }) if err != nil { diff --git a/nodes/filepath-join-array@v1.go b/nodes/filepath-join-array@v1.go index 428f7e3..387c48b 100644 --- a/nodes/filepath-join-array@v1.go +++ b/nodes/filepath-join-array@v1.go @@ -28,7 +28,7 @@ func (n *FilepathJoinFromArrayNode) OutputValueById(c *core.ExecutionState, outp } func init() { - err := core.RegisterNodeFactory(filepathJoinFromArrayNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(filepathJoinFromArrayNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FilepathJoinFromArrayNode{}, nil }) if err != nil { diff --git a/nodes/filepath-join@v1.go b/nodes/filepath-join@v1.go index d90f847..2deabe4 100644 --- a/nodes/filepath-join@v1.go +++ b/nodes/filepath-join@v1.go @@ -28,7 +28,7 @@ func (n *FilepathJoin) OutputValueById(c *core.ExecutionState, outputId core.Out } func init() { - err := core.RegisterNodeFactory(filepathJoinDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(filepathJoinDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FilepathJoin{}, nil }) if err != nil { diff --git a/nodes/filepath-location@v1.go b/nodes/filepath-location@v1.go index d1206b3..c4dce7d 100644 --- a/nodes/filepath-location@v1.go +++ b/nodes/filepath-location@v1.go @@ -80,7 +80,7 @@ func (n *FilepathLocation) OutputValueById(c *core.ExecutionState, outputId core } func init() { - err := core.RegisterNodeFactory(filepathLocationDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(filepathLocationDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FilepathLocation{}, nil }) if err != nil { diff --git a/nodes/filepath-op@v1.go b/nodes/filepath-op@v1.go index 45a8b2a..89b9255 100644 --- a/nodes/filepath-op@v1.go +++ b/nodes/filepath-op@v1.go @@ -50,7 +50,7 @@ func (n *FilepathOp) OutputValueById(c *core.ExecutionState, outputId core.Outpu } func init() { - err := core.RegisterNodeFactory(filepathOpDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(filepathOpDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FilepathOp{}, nil }) if err != nil { diff --git a/nodes/filepath-rel@v1.go b/nodes/filepath-rel@v1.go index 1411559..ac8bfa1 100644 --- a/nodes/filepath-rel@v1.go +++ b/nodes/filepath-rel@v1.go @@ -32,7 +32,7 @@ func (n *FilepathRelative) OutputValueById(c *core.ExecutionState, outputId core } func init() { - err := core.RegisterNodeFactory(filepathRelativeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(filepathRelativeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FilepathRelative{}, nil }) if err != nil { diff --git a/nodes/filepath-sort@v1.go b/nodes/filepath-sort@v1.go index 7c2d865..4543670 100644 --- a/nodes/filepath-sort@v1.go +++ b/nodes/filepath-sort@v1.go @@ -55,7 +55,7 @@ func (n *FilepathSort) OutputValueById(c *core.ExecutionState, outputId core.Out } func init() { - err := core.RegisterNodeFactory(filepathSortDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(filepathSortDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FilepathSort{}, nil }) if err != nil { diff --git a/nodes/for-each-loop@v1.go b/nodes/for-each-loop@v1.go index b4ad196..65cfac2 100644 --- a/nodes/for-each-loop@v1.go +++ b/nodes/for-each-loop@v1.go @@ -66,7 +66,7 @@ func (n *ForEachLoopNode) ExecuteImpl(c *core.ExecutionState, inputId core.Input } func init() { - err := core.RegisterNodeFactory(forEachLoopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(forEachLoopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ForEachLoopNode{}, nil }) if err != nil { diff --git a/nodes/for-loop@v1.go b/nodes/for-loop@v1.go index 51bd1fe..632cde8 100644 --- a/nodes/for-loop@v1.go +++ b/nodes/for-loop@v1.go @@ -67,7 +67,7 @@ func (n *LoopNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pre } func init() { - err := core.RegisterNodeFactory(loopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(loopDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &LoopNode{}, nil }) if err != nil { diff --git a/nodes/freeze@v1.go b/nodes/freeze@v1.go index 02fac6d..4997f3e 100644 --- a/nodes/freeze@v1.go +++ b/nodes/freeze@v1.go @@ -59,7 +59,7 @@ func (n *FreezeNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, p } func init() { - err := core.RegisterNodeFactory(freezeNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(freezeNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &FreezeNode{}, nil }) if err != nil { diff --git a/nodes/gh-start@v1.go b/nodes/gh-start@v1.go index 5b88dd1..731e914 100644 --- a/nodes/gh-start@v1.go +++ b/nodes/gh-start@v1.go @@ -176,7 +176,7 @@ func (n *GhActionStartNode) GetStartOutput(c *core.ExecutionState) (core.OutputI } func init() { - err := core.RegisterNodeFactory(GithubActionStartNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(GithubActionStartNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GhActionStartNode{}, nil }) if err != nil { diff --git a/nodes/git-checkout@v1.go b/nodes/git-checkout@v1.go index 32c414e..6b17903 100644 --- a/nodes/git-checkout@v1.go +++ b/nodes/git-checkout@v1.go @@ -72,7 +72,7 @@ func (n *GitCheckoutNode) ExecuteImpl(c *core.ExecutionState, inputId core.Input } func init() { - err := core.RegisterNodeFactory(gitCheckoutDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(gitCheckoutDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GitCheckoutNode{}, nil }) if err != nil { diff --git a/nodes/git-clone@v1.go b/nodes/git-clone@v1.go index d62f706..12134d0 100644 --- a/nodes/git-clone@v1.go +++ b/nodes/git-clone@v1.go @@ -120,7 +120,7 @@ func (n *GitCloneNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(gitCloneDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(gitCloneDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GitCloneNode{}, nil }) if err != nil { diff --git a/nodes/git-commit@v1.go b/nodes/git-commit@v1.go index 2c4b8b5..17ffe25 100644 --- a/nodes/git-commit@v1.go +++ b/nodes/git-commit@v1.go @@ -86,7 +86,7 @@ func (n *GitCommitNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId } func init() { - err := core.RegisterNodeFactory(gitCommitDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(gitCommitDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GitCommitNode{}, nil }) if err != nil { diff --git a/nodes/git-pull@v1.go b/nodes/git-pull@v1.go index 56ecf27..fd1a013 100644 --- a/nodes/git-pull@v1.go +++ b/nodes/git-pull@v1.go @@ -70,7 +70,7 @@ func (n *GitPullNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(gitPullDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(gitPullDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GitPullNode{}, nil }) if err != nil { diff --git a/nodes/git-push@v1.go b/nodes/git-push@v1.go index 48e6411..c682f01 100644 --- a/nodes/git-push@v1.go +++ b/nodes/git-push@v1.go @@ -102,7 +102,7 @@ func (n *GitPushNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(gitPushDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(gitPushDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GitPushNode{}, nil }) if err != nil { diff --git a/nodes/git-stage@v1.go b/nodes/git-stage@v1.go index 9550b66..4706d95 100644 --- a/nodes/git-stage@v1.go +++ b/nodes/git-stage@v1.go @@ -60,7 +60,7 @@ func (n *GitStageNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(gitStageDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(gitStageDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GitStageNode{}, nil }) if err != nil { diff --git a/nodes/group-inputs@v1.go b/nodes/group-inputs@v1.go index b4cb63f..1c08bf2 100644 --- a/nodes/group-inputs@v1.go +++ b/nodes/group-inputs@v1.go @@ -45,7 +45,7 @@ func (n *GroupInputsNode) ExecuteImpl(c *core.ExecutionState, inputId core.Input } func init() { - err := core.RegisterNodeFactory(groupInputsDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(groupInputsDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GroupInputsNode{}, nil }) if err != nil { diff --git a/nodes/group-outputs@v1.go b/nodes/group-outputs@v1.go index eafc978..c19f49c 100644 --- a/nodes/group-outputs@v1.go +++ b/nodes/group-outputs@v1.go @@ -36,7 +36,7 @@ func (n *GroupOutputsNode) ExecuteImpl(c *core.ExecutionState, inputId core.Inpu } func init() { - err := core.RegisterNodeFactory(groupOutputsDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(groupOutputsDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &GroupOutputsNode{}, nil }) if err != nil { diff --git a/nodes/group@v1.go b/nodes/group@v1.go index be295d8..1419a59 100644 --- a/nodes/group@v1.go +++ b/nodes/group@v1.go @@ -108,7 +108,7 @@ func (n *GroupNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pr func init() { // Factory function now accepts 'validate' and returns []error - err := core.RegisterNodeFactory(subgraphDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(subgraphDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { var collectedErrors []error subGraph, ok := nodeDef["graph"].(map[string]any) @@ -179,7 +179,7 @@ func init() { } } - ag, errs := core.LoadGraph(subGraph, group, parentId, validate) + ag, errs := core.LoadGraph(subGraph, group, parentId, validate, opts) if len(errs) > 0 { if !validate { return nil, errs diff --git a/nodes/hash@v1.go b/nodes/hash@v1.go index 58579c1..a2baf48 100644 --- a/nodes/hash@v1.go +++ b/nodes/hash@v1.go @@ -116,7 +116,7 @@ func (n *HashNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pre } func init() { - err := core.RegisterNodeFactory(hashDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(hashDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &HashNode{}, nil }) if err != nil { diff --git a/nodes/http@v1.go b/nodes/http@v1.go index ce6b1fd..e44b50a 100644 --- a/nodes/http@v1.go +++ b/nodes/http@v1.go @@ -148,7 +148,7 @@ func (n *HttpNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pre } func init() { - err := core.RegisterNodeFactory(httpDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(httpDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &HttpNode{}, nil }) if err != nil { diff --git a/nodes/item-stats@v1.go b/nodes/item-stats@v1.go index e725340..1163aba 100644 --- a/nodes/item-stats@v1.go +++ b/nodes/item-stats@v1.go @@ -93,7 +93,7 @@ func (n *ItemStatsNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId } func init() { - err := core.RegisterNodeFactory(itemStatsDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(itemStatsDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ItemStatsNode{}, nil }) if err != nil { diff --git a/nodes/length@v1.go b/nodes/length@v1.go index f8ca857..4dc3240 100644 --- a/nodes/length@v1.go +++ b/nodes/length@v1.go @@ -44,7 +44,7 @@ func (n *LengthNode) OutputValueById(c *core.ExecutionState, outputId core.Outpu } func init() { - err := core.RegisterNodeFactory(lengthDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(lengthDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &LengthNode{}, nil }) if err != nil { diff --git a/nodes/llm-prompt@v1.go b/nodes/llm-prompt@v1.go index 4ce6ec6..61ce9b8 100644 --- a/nodes/llm-prompt@v1.go +++ b/nodes/llm-prompt@v1.go @@ -202,7 +202,7 @@ func defaultTemperature(model string) float64 { } func init() { - err := core.RegisterNodeFactory(llmGenerateDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(llmGenerateDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &LlmGenerateNode{}, nil }) if err != nil { diff --git a/nodes/math-compare-op@v1.go b/nodes/math-compare-op@v1.go index 1ce109f..95e91d0 100644 --- a/nodes/math-compare-op@v1.go +++ b/nodes/math-compare-op@v1.go @@ -106,7 +106,7 @@ func init() { } for _, op := range ops { - err := core.RegisterNodeFactory(op.definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(op.definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &MathCompareOpNode{ op: op.op, }, nil diff --git a/nodes/math-compare@v1.go b/nodes/math-compare@v1.go index a6a2eba..0b8468a 100644 --- a/nodes/math-compare@v1.go +++ b/nodes/math-compare@v1.go @@ -55,7 +55,7 @@ func (n *CompareNode) OutputValueById(c *core.ExecutionState, outputId core.Outp } func init() { - err := core.RegisterNodeFactory(mathCompareDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(mathCompareDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &CompareNode{}, nil }) if err != nil { diff --git a/nodes/math-op@v1.go b/nodes/math-op@v1.go index f63e959..29d200f 100644 --- a/nodes/math-op@v1.go +++ b/nodes/math-op@v1.go @@ -20,7 +20,7 @@ func (n *MathOpNode) OutputValueById(c *core.ExecutionState, outputId core.Outpu } func init() { - err := core.RegisterNodeFactory(mathOpDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(mathOpDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &MathOpNode{}, nil }) if err != nil { diff --git a/nodes/math@v1.go b/nodes/math@v1.go index a39e15c..dc724d7 100644 --- a/nodes/math@v1.go +++ b/nodes/math@v1.go @@ -83,7 +83,7 @@ func init() { } for _, op := range ops { - err := core.RegisterNodeFactory(op.definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(op.definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &MathNode{ op: op.op, }, nil diff --git a/nodes/negate@v1.go b/nodes/negate@v1.go index ef5192d..41ac257 100644 --- a/nodes/negate@v1.go +++ b/nodes/negate@v1.go @@ -26,7 +26,7 @@ func (n *NegateNode) OutputValueById(c *core.ExecutionState, outputId core.Outpu } func init() { - err := core.RegisterNodeFactory(negateDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(negateDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &NegateNode{}, nil }) if err != nil { diff --git a/nodes/nrun-python-embedded@v1.go b/nodes/nrun-python-embedded@v1.go index 4456522..8376d1c 100644 --- a/nodes/nrun-python-embedded@v1.go +++ b/nodes/nrun-python-embedded@v1.go @@ -12,7 +12,7 @@ import ( var runExecPython string func init() { - err := core.RegisterNodeFactory(runExecPython, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(runExecPython, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return nil, []error{core.CreateErr(nil, nil, "node 'Run Python Embedded' (%v) not available", nodeDef["id"]).SetHint(`the node can only be used if the action graph is run within a Python environment. For more information check the link below. https://docs.actionforge.dev/nodes/core/run-python-embedded/v1/#not-available`)} }) diff --git a/nodes/number-array@v1.go b/nodes/number-array@v1.go index 3c456d0..7d6cfb5 100644 --- a/nodes/number-array@v1.go +++ b/nodes/number-array@v1.go @@ -26,7 +26,7 @@ func (n *NumberArrayNode) OutputValueById(c *core.ExecutionState, outputId core. } func init() { - err := core.RegisterNodeFactory(numberArrayDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(numberArrayDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &NumberArrayNode{}, nil }) if err != nil { diff --git a/nodes/parser@v1.go b/nodes/parser@v1.go index b8c20cb..45ba64c 100644 --- a/nodes/parser@v1.go +++ b/nodes/parser@v1.go @@ -146,7 +146,7 @@ func init() { gob.Register([]any{}) gob.Register(map[string]any{}) - err := core.RegisterNodeFactory(parseDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(parseDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ParserNode{}, nil }) if err != nil { diff --git a/nodes/print@v1.go b/nodes/print@v1.go index d5af93b..3ab7101 100644 --- a/nodes/print@v1.go +++ b/nodes/print@v1.go @@ -109,7 +109,7 @@ func (n *PrintNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pr } func init() { - err := core.RegisterNodeFactory(printDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(printDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &PrintNode{}, nil }) if err != nil { diff --git a/nodes/process-exit@v1.go b/nodes/process-exit@v1.go index 6460d85..03aced1 100644 --- a/nodes/process-exit@v1.go +++ b/nodes/process-exit@v1.go @@ -29,7 +29,7 @@ func (n *ExitNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pre } func init() { - err := core.RegisterNodeFactory(exitDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(exitDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ExitNode{}, nil }) if err != nil { diff --git a/nodes/property-getter@v1.go b/nodes/property-getter@v1.go index a2fc428..69e449e 100644 --- a/nodes/property-getter@v1.go +++ b/nodes/property-getter@v1.go @@ -58,7 +58,7 @@ func (n *PropertyGetterDefinition) ExecuteImpl(c *core.ExecutionState, inputId c } func init() { - err := core.RegisterNodeFactory(propertyGetterDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(propertyGetterDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &PropertyGetterDefinition{}, nil }) if err != nil { diff --git a/nodes/property-setter@v1.go b/nodes/property-setter@v1.go index 17b5e81..86524b1 100644 --- a/nodes/property-setter@v1.go +++ b/nodes/property-setter@v1.go @@ -72,7 +72,7 @@ func (n *PropertySetterNode) ExecuteImpl(c *core.ExecutionState, inputId core.In } func init() { - err := core.RegisterNodeFactory(propertySetterDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(propertySetterDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &PropertySetterNode{}, nil }) if err != nil { diff --git a/nodes/random-number@v1.go b/nodes/random-number@v1.go index 5f5678f..392df34 100644 --- a/nodes/random-number@v1.go +++ b/nodes/random-number@v1.go @@ -59,7 +59,7 @@ func (n *RandomNumberNode) ExecuteImpl(c *core.ExecutionState, inputId core.Inpu } func init() { - err := core.RegisterNodeFactory(randomNumberNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(randomNumberNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &RandomNumberNode{}, nil }) if err != nil { diff --git a/nodes/random-stream@v1.go b/nodes/random-stream@v1.go index ff16e65..c588e6e 100644 --- a/nodes/random-stream@v1.go +++ b/nodes/random-stream@v1.go @@ -135,7 +135,7 @@ func (n *RandomStreamNode) ExecuteImpl(c *core.ExecutionState, inputId core.Inpu } func init() { - err := core.RegisterNodeFactory(randomStreamNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(randomStreamNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &RandomStreamNode{}, nil }) if err != nil { diff --git a/nodes/run-exec@v1.go b/nodes/run-exec@v1.go index 258b757..576b043 100644 --- a/nodes/run-exec@v1.go +++ b/nodes/run-exec@v1.go @@ -122,7 +122,7 @@ func (n *RunExecNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(runExecDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(runExecDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &RunExecNode{}, nil }) if err != nil { diff --git a/nodes/run-python-embedded@v1.go b/nodes/run-python-embedded@v1.go index cae0718..9c306b7 100644 --- a/nodes/run-python-embedded@v1.go +++ b/nodes/run-python-embedded@v1.go @@ -53,7 +53,7 @@ func (n *RunPythonEmbedded) ExecuteImpl(c *core.ExecutionState, inputId core.Inp } func init() { - err := core.RegisterNodeFactory(runExecPython, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(runExecPython, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &RunPythonEmbedded{}, nil }) if err != nil { diff --git a/nodes/run@v1.go b/nodes/run@v1.go index 5f31186..c4511b4 100644 --- a/nodes/run@v1.go +++ b/nodes/run@v1.go @@ -388,7 +388,7 @@ func runAndCaptureOutput(c *core.ExecutionState, cmd *exec.Cmd, print string, co } func init() { - err := core.RegisterNodeFactory(runDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(runDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &RunNode{}, nil }) if err != nil { diff --git a/nodes/secret-get@v1.go b/nodes/secret-get@v1.go index 3f7598f..cc19eb4 100644 --- a/nodes/secret-get@v1.go +++ b/nodes/secret-get@v1.go @@ -43,7 +43,7 @@ func (n *SecretNode) OutputValueById(c *core.ExecutionState, outputId core.Outpu } func init() { - err := core.RegisterNodeFactory(secretDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(secretDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SecretNode{}, nil }) if err != nil { diff --git a/nodes/secret-set@v1.go b/nodes/secret-set@v1.go index fa84b55..5427c85 100644 --- a/nodes/secret-set@v1.go +++ b/nodes/secret-set@v1.go @@ -34,7 +34,7 @@ func (n *SetSecretNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId } func init() { - err := core.RegisterNodeFactory(setSecretDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(setSecretDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SetSecretNode{}, nil }) if err != nil { diff --git a/nodes/select-data@v1.go b/nodes/select-data@v1.go index 1b90069..fa02993 100644 --- a/nodes/select-data@v1.go +++ b/nodes/select-data@v1.go @@ -38,7 +38,7 @@ func (n *SelectDataNode) OutputValueById(c *core.ExecutionState, outputId core.O } func init() { - err := core.RegisterNodeFactory(selectDataNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(selectDataNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SelectDataNode{}, nil }) if err != nil { diff --git a/nodes/select-exec@v1.go b/nodes/select-exec@v1.go index 9669db6..50a7e7e 100644 --- a/nodes/select-exec@v1.go +++ b/nodes/select-exec@v1.go @@ -38,7 +38,7 @@ func (n *SelectExecNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputI } func init() { - err := core.RegisterNodeFactory(selectExecNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(selectExecNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SelectExecNode{}, nil }) if err != nil { diff --git a/nodes/sequence@v1.go b/nodes/sequence@v1.go index fb9a518..f3dd033 100644 --- a/nodes/sequence@v1.go +++ b/nodes/sequence@v1.go @@ -58,7 +58,7 @@ func (n *SequenceNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(sequenceDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(sequenceDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SequenceNode{}, nil }) if err != nil { diff --git a/nodes/serializer@v1.go b/nodes/serializer@v1.go index a380660..62e0619 100644 --- a/nodes/serializer@v1.go +++ b/nodes/serializer@v1.go @@ -114,7 +114,7 @@ func (n *SerializerNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputI } func init() { - err := core.RegisterNodeFactory(serializeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(serializeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SerializerNode{}, nil }) if err != nil { diff --git a/nodes/sleep@v1.go b/nodes/sleep@v1.go index 57b14ae..25bcd77 100644 --- a/nodes/sleep@v1.go +++ b/nodes/sleep@v1.go @@ -58,7 +58,7 @@ func (n *SleepNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pr } func init() { - err := core.RegisterNodeFactory(sleepNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(sleepNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SleepNode{}, nil }) if err != nil { diff --git a/nodes/start@v1.go b/nodes/start@v1.go index a00102d..6f1e293 100644 --- a/nodes/start@v1.go +++ b/nodes/start@v1.go @@ -56,7 +56,7 @@ func (n *StartNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, pr } func init() { - err := core.RegisterNodeFactory(startNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(startNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StartNode{}, nil }) if err != nil { diff --git a/nodes/storage-delete@v1.go b/nodes/storage-delete@v1.go index 784c50c..bc327e2 100644 --- a/nodes/storage-delete@v1.go +++ b/nodes/storage-delete@v1.go @@ -60,7 +60,7 @@ func (n *StorageDeleteNode) ExecuteImpl(c *core.ExecutionState, inputId core.Inp } func init() { - err := core.RegisterNodeFactory(storageDeleteDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(storageDeleteDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StorageDeleteNode{}, nil }) if err != nil { diff --git a/nodes/storage-download@v1.go b/nodes/storage-download@v1.go index 784d950..f51e531 100644 --- a/nodes/storage-download@v1.go +++ b/nodes/storage-download@v1.go @@ -60,7 +60,7 @@ func (n *StorageDownloadNode) ExecuteImpl(c *core.ExecutionState, inputId core.I } func init() { - err := core.RegisterNodeFactory(storageDownloadDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(storageDownloadDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StorageDownloadNode{}, nil }) if err != nil { diff --git a/nodes/storage-provider-s3@v1.go b/nodes/storage-provider-s3@v1.go index fa0eecf..52dfb57 100644 --- a/nodes/storage-provider-s3@v1.go +++ b/nodes/storage-provider-s3@v1.go @@ -103,7 +103,7 @@ func createS3Config(accessKey, secretKey, region, endpoint string) (aws.Config, } func init() { - err := core.RegisterNodeFactory(storageProviderS3Definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(storageProviderS3Definition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StorageProviderS3{}, nil }) if err != nil { diff --git a/nodes/storage-upload@v1.go b/nodes/storage-upload@v1.go index 2ab569c..f12bbd2 100644 --- a/nodes/storage-upload@v1.go +++ b/nodes/storage-upload@v1.go @@ -107,7 +107,7 @@ func (n *StorageUploadNode) ExecuteImpl(c *core.ExecutionState, inputId core.Inp } func init() { - err := core.RegisterNodeFactory(storageUploadDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(storageUploadDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StorageUploadNode{}, nil }) if err != nil { diff --git a/nodes/storage-walk@v1.go b/nodes/storage-walk@v1.go index 7388439..09347c4 100644 --- a/nodes/storage-walk@v1.go +++ b/nodes/storage-walk@v1.go @@ -116,7 +116,7 @@ func (n *StorageListNode) ExecuteImpl(c *core.ExecutionState, inputId core.Input } func init() { - err := core.RegisterNodeFactory(s3ListDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(s3ListDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StorageListNode{}, nil }) if err != nil { diff --git a/nodes/stream-cache@v1.go b/nodes/stream-cache@v1.go index e57cfbe..2ab8571 100644 --- a/nodes/stream-cache@v1.go +++ b/nodes/stream-cache@v1.go @@ -45,7 +45,7 @@ func (n *StreamCacheNode) ExecuteImpl(c *core.ExecutionState, inputId core.Input } func init() { - err := core.RegisterNodeFactory(streamCacheNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(streamCacheNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StreamCacheNode{}, nil }) if err != nil { diff --git a/nodes/string-array@v1.go b/nodes/string-array@v1.go index 9375a5a..e486741 100644 --- a/nodes/string-array@v1.go +++ b/nodes/string-array@v1.go @@ -26,7 +26,7 @@ func (n *StringArrayNode) OutputValueById(c *core.ExecutionState, outputId core. } func init() { - err := core.RegisterNodeFactory(stringArrayDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringArrayDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringArrayNode{}, nil }) if err != nil { diff --git a/nodes/string-decode@v1.go b/nodes/string-decode@v1.go index 88fece1..29fff44 100644 --- a/nodes/string-decode@v1.go +++ b/nodes/string-decode@v1.go @@ -195,7 +195,7 @@ func unescapeXML(s string) string { } func init() { - err := core.RegisterNodeFactory(stringDecodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringDecodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringDecode{}, nil }) if err != nil { diff --git a/nodes/string-encode@v1.go b/nodes/string-encode@v1.go index 834932b..5a62caa 100644 --- a/nodes/string-encode@v1.go +++ b/nodes/string-encode@v1.go @@ -149,7 +149,7 @@ func escapeXML(s string) string { } func init() { - err := core.RegisterNodeFactory(stringEncodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringEncodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringEncode{}, nil }) if err != nil { diff --git a/nodes/string-fmt@v1.go b/nodes/string-fmt@v1.go index f5cc344..d222199 100644 --- a/nodes/string-fmt@v1.go +++ b/nodes/string-fmt@v1.go @@ -49,7 +49,7 @@ func (n *StringFmt) OutputValueById(c *core.ExecutionState, outputId core.Output } func init() { - err := core.RegisterNodeFactory(stringFmtDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringFmtDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { // this definition ensures that the number of format verbs in the format string // matches the number of substitution inputs. This can be done if the format string // is already predefined and not dynamic (in that case, there is another check above in OutputValueById). diff --git a/nodes/string-join-array@v1.go b/nodes/string-join-array@v1.go index cba3a8a..9f5d668 100644 --- a/nodes/string-join-array@v1.go +++ b/nodes/string-join-array@v1.go @@ -33,7 +33,7 @@ func (n *StringJoinFromArrayNode) OutputValueById(c *core.ExecutionState, output } func init() { - err := core.RegisterNodeFactory(stringJoinFromArrayNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringJoinFromArrayNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringJoinFromArrayNode{}, nil }) if err != nil { diff --git a/nodes/string-join@v1.go b/nodes/string-join@v1.go index 063027b..83b054a 100644 --- a/nodes/string-join@v1.go +++ b/nodes/string-join@v1.go @@ -33,7 +33,7 @@ func (n *StringJoinNode) OutputValueById(c *core.ExecutionState, outputId core.O } func init() { - err := core.RegisterNodeFactory(stringJoinNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringJoinNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringJoinNode{}, nil }) if err != nil { diff --git a/nodes/string-match-regex@v1.go b/nodes/string-match-regex@v1.go index 340bbe9..ad9cf7e 100644 --- a/nodes/string-match-regex@v1.go +++ b/nodes/string-match-regex@v1.go @@ -46,7 +46,7 @@ func (n *StringMatchRegexNode) OutputValueById(c *core.ExecutionState, outputId } func init() { - err := core.RegisterNodeFactory(stringMatchRegexDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringMatchRegexDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringMatchRegexNode{}, nil }) if err != nil { diff --git a/nodes/string-match@v1.go b/nodes/string-match@v1.go index b944dae..4af8d87 100644 --- a/nodes/string-match@v1.go +++ b/nodes/string-match@v1.go @@ -53,7 +53,7 @@ func (n *StringMatchNode) OutputValueById(c *core.ExecutionState, outputId core. } func init() { - err := core.RegisterNodeFactory(stringMatchDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringMatchDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringMatchNode{}, nil }) if err != nil { diff --git a/nodes/string-replace@v1.go b/nodes/string-replace@v1.go index 1511d05..2f8c45a 100644 --- a/nodes/string-replace@v1.go +++ b/nodes/string-replace@v1.go @@ -54,7 +54,7 @@ func (n *StringReplaceNode) OutputValueById(c *core.ExecutionState, outputId cor } func init() { - err := core.RegisterNodeFactory(stringReplaceDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringReplaceDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringReplaceNode{}, nil }) if err != nil { diff --git a/nodes/string-split@v1.go b/nodes/string-split@v1.go index b733aeb..c91395d 100644 --- a/nodes/string-split@v1.go +++ b/nodes/string-split@v1.go @@ -57,7 +57,7 @@ func splitString(str, delimiter string, maxSegments int) []string { } func init() { - err := core.RegisterNodeFactory(splitDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(splitDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SplitNode{}, nil }) if err != nil { diff --git a/nodes/string-transform@v1.go b/nodes/string-transform@v1.go index 025089c..c0546be 100644 --- a/nodes/string-transform@v1.go +++ b/nodes/string-transform@v1.go @@ -67,7 +67,7 @@ func (n *StringTransform) OutputValueById(c *core.ExecutionState, outputId core. } func init() { - err := core.RegisterNodeFactory(stringTransformDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(stringTransformDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &StringTransform{}, nil }) if err != nil { diff --git a/nodes/switch-arch@v1.go b/nodes/switch-arch@v1.go index ef78f19..edb2947 100644 --- a/nodes/switch-arch@v1.go +++ b/nodes/switch-arch@v1.go @@ -39,7 +39,7 @@ func (n *ArchSwitchNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputI } func init() { - err := core.RegisterNodeFactory(archSwitchDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(archSwitchDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &ArchSwitchNode{}, nil }) if err != nil { diff --git a/nodes/switch-platform@v1.go b/nodes/switch-platform@v1.go index 00ce379..94deabf 100644 --- a/nodes/switch-platform@v1.go +++ b/nodes/switch-platform@v1.go @@ -41,7 +41,7 @@ func (n *PlatformSwitchNode) ExecuteImpl(c *core.ExecutionState, inputId core.In } func init() { - err := core.RegisterNodeFactory(platformSwitchDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(platformSwitchDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &PlatformSwitchNode{}, nil }) if err != nil { diff --git a/nodes/system-info@v1.go b/nodes/system-info@v1.go index f89e10c..2165435 100644 --- a/nodes/system-info@v1.go +++ b/nodes/system-info@v1.go @@ -72,7 +72,7 @@ func (n *SystemInfoNode) OutputValueById(c *core.ExecutionState, outputId core.O } func init() { - err := core.RegisterNodeFactory(systemInfoDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(systemInfoDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &SystemInfoNode{}, nil }) if err != nil { diff --git a/nodes/test@v1.go b/nodes/test@v1.go index 27f0e64..48543ab 100644 --- a/nodes/test@v1.go +++ b/nodes/test@v1.go @@ -24,7 +24,7 @@ func (n *TestNode) OutputValueById(c *core.ExecutionState, outputId core.OutputI } func init() { - err := core.RegisterNodeFactory(testNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(testNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &TestNode{}, nil }) if err != nil { diff --git a/nodes/test@v1_test.go b/nodes/test@v1_test.go index aa87ca4..7d56f5d 100644 --- a/nodes/test@v1_test.go +++ b/nodes/test@v1_test.go @@ -24,7 +24,7 @@ import ( // Test that the node type exists. func Test_NewNodeInstance_Exists(t *testing.T) { - n, err := core.NewNodeInstance("core/run@v1", nil, "", nil, false) + n, err := core.NewNodeInstance("core/run@v1", nil, "", nil, false, core.RunOpts{}) if err != nil { t.Fatal(err) } @@ -36,7 +36,7 @@ func Test_NewNodeInstance_Exists(t *testing.T) { // Test that the node type doesn't exist func Test_NewNodeInstance_NotExists(t *testing.T) { - _, err := core.NewNodeInstance("abc@v2", nil, "", nil, false) + _, err := core.NewNodeInstance("abc@v2", nil, "", nil, false, core.RunOpts{}) if err == nil { t.Error("expected error") return @@ -356,7 +356,7 @@ executions: [] return nil, nil, nil, nil, err } - ag, errs := core.LoadGraph(graphYaml, nil, "", false) + ag, errs := core.LoadGraph(graphYaml, nil, "", false, core.RunOpts{}) if errs != nil { return nil, nil, nil, nil, errs[0] } diff --git a/nodes/wait-for@v1.go b/nodes/wait-for@v1.go index 816560d..db0ae45 100644 --- a/nodes/wait-for@v1.go +++ b/nodes/wait-for@v1.go @@ -84,7 +84,7 @@ func (n *WaitForNode) ExecuteImpl(c *core.ExecutionState, inputId core.InputId, } func init() { - err := core.RegisterNodeFactory(waitForDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(waitForDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { return &WaitForNode{ Lock: sync.Mutex{}, CurrentCounter: -1, diff --git a/tests_unit/core_test.go b/tests_unit/core_test.go index 09c49f3..3f55952 100644 --- a/tests_unit/core_test.go +++ b/tests_unit/core_test.go @@ -55,7 +55,7 @@ func TestPortValidation(t *testing.T) { // Run a simple script/program and check that the output is correct. func Test_NewNodeInstance(t *testing.T) { - n, err := core.NewNodeInstance("core/run@v1", nil, "", nil, false) + n, err := core.NewNodeInstance("core/run@v1", nil, "", nil, false, core.RunOpts{}) if err != nil { t.Fatal(err) } From 0b831b94fb5bac819136811222a636d697d6d2f9 Mon Sep 17 00:00:00 2001 From: Sebatian Rath Date: Thu, 29 Jan 2026 23:22:36 -0500 Subject: [PATCH 2/3] Improve token and workspace resolution in gh-action node --- nodes/gh-action@v1.go | 48 ++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/nodes/gh-action@v1.go b/nodes/gh-action@v1.go index 9e28044..c172bc9 100644 --- a/nodes/gh-action@v1.go +++ b/nodes/gh-action@v1.go @@ -360,7 +360,7 @@ func (n *GhActionNode) ExecuteDocker(c *core.ExecutionState, workingDirectory st } func init() { - err := core.RegisterNodeFactory(ghActionNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool) (core.NodeBaseInterface, []error) { + err := core.RegisterNodeFactory(ghActionNodeDefinition, func(ctx any, parent core.NodeBaseInterface, parentId string, nodeDef map[string]any, validate bool, opts core.RunOpts) (core.NodeBaseInterface, []error) { nodeType := ctx.(string) @@ -374,36 +374,47 @@ func init() { return nil, []error{core.CreateErr(nil, err, "unable to get user home directory")} } - // repoRoot is where the git repository is stored locall + // actionRepoRoot is where the git repository is stored locall // ~/work/_actions/{owner}/{repo}/{ref} - repoRoot := filepath.Join(home, "work", "_actions", owner, repo, ref) + actionRepoRoot := filepath.Join(home, "work", "_actions", owner, repo, ref) // actionDir is where the action.yml lives of the action which is not always the repo root it seems // If the action is in the root, path is empty // If the action is in a subdir like "github.com/owner/repo/sub/path", path is just "sub/path" - actionDir := filepath.Join(repoRoot, path) + actionDir := filepath.Join(actionRepoRoot, path) - _, ok := os.LookupEnv("GITHUB_ACTIONS") - if !ok { - return nil, []error{core.CreateErr(nil, nil, "environment not configured yet to run GitHub Actions.").SetHint( - "In order to run GitHub Actions, please follow the instructions at https://docs.actionforge.dev/reference/github-actions/#configure"), - } + isGitHubAction := opts.OverrideEnv["GITHUB_ACTIONS"] == "true" || os.Getenv("GITHUB_ACTIONS") == "true" + if !isGitHubAction { + return nil, []error{core.CreateErr(nil, nil, "node representing GitHub Action '%v' can only be used in a GitHub Actions workflow.", nodeType)} } - // Reminder that INPUT_* env vars are only prefixed for the graph execution, not here - ghToken := os.Getenv("INPUT_TOKEN") + // Reminder: + // `INPUT_TOKEN` comes from the GitHub Action actionforge/action. + // `GITHUB_TOKEN` is manually provided, eg through the web app and has a higher precedence. + // GITHUB_TOKEN should always be set via secrets, but just in case the user provides it via env, check also there + ghToken := opts.OverrideSecrets["GITHUB_TOKEN"] + if ghToken == "" { + ghToken = opts.OverrideEnv["GITHUB_TOKEN"] + if ghToken == "" { + ghToken = os.Getenv("GITHUB_TOKEN") + if ghToken == "" { + // Note that `INPUT_*` env vars are only prefixed for the graph execution, not here + ghToken = os.Getenv("INPUT_TOKEN") + } + } + } // TODO: (Seb) for the validation process we only need the action.yml, not the entire repo // so check if we are in validate mode and only download the action.yml file - _, err = os.Stat(repoRoot) + _, err = os.Stat(actionRepoRoot) if errors.Is(err, os.ErrNotExist) { if ghToken == "" { - return nil, []error{core.CreateErr(nil, nil, "INPUT_TOKEN not set")} + return nil, []error{core.CreateErr(nil, nil, "neither GITHUB_TOKEN nor INPUT_TOKEN are set")} } cloneUrl := fmt.Sprintf("https://github.com/%s/%s", owner, repo) - if err := os.MkdirAll(filepath.Dir(repoRoot), 0755); err != nil { + if err := os.MkdirAll(filepath.Dir(actionRepoRoot), 0755); err != nil { return nil, []error{core.CreateErr(nil, err, "unable to create action directory")} } @@ -419,7 +430,7 @@ func init() { Password: ghToken, } - clonedRepo, err := git.PlainClone(repoRoot, false, cloneOpts) + clonedRepo, err := git.PlainClone(actionRepoRoot, false, cloneOpts) if err != nil { return nil, []error{core.CreateErr(nil, err, "failed to clone repository")} } @@ -448,7 +459,7 @@ func init() { } } else { // reset in just case something tampered with the cached gh actions - existingRepo, err := git.PlainOpen(repoRoot) + existingRepo, err := git.PlainOpen(actionRepoRoot) if err != nil { return nil, []error{core.CreateErr(nil, err, "failed to open cached repository")} } @@ -501,7 +512,10 @@ func init() { switch action.Runs.Using { case "docker": - sysWorkspaceDir := os.Getenv("GITHUB_WORKSPACE") + sysWorkspaceDir := opts.OverrideEnv["GITHUB_WORKSPACE"] + if sysWorkspaceDir == "" { + sysWorkspaceDir = os.Getenv("GITHUB_WORKSPACE") + } if sysWorkspaceDir == "" { return nil, []error{core.CreateErr(nil, nil, "GITHUB_WORKSPACE not set")} } From 3295aad2ec9dc3b352b1fc95a060c575ae856826 Mon Sep 17 00:00:00 2001 From: Sebatian Rath Date: Thu, 29 Jan 2026 23:45:13 -0500 Subject: [PATCH 3/3] Update e2e test reference files --- tests_e2e/references/reference_app.sh_l12 | 2 +- tests_e2e/references/reference_dir-walk.sh_l56 | 6 +++--- tests_e2e/references/reference_error_no_output.sh_l8 | 6 +++--- tests_e2e/references/reference_group-error.sh_l8 | 4 ++-- .../references/reference_group-port-collision.sh_l13 | 10 +++++----- tests_e2e/references/reference_index.sh_l20 | 6 +++--- .../references/reference_run-python-embedded.sh_l13 | 10 +++++----- tests_e2e/references/reference_s3_aws_walk.sh_l22 | 6 +++--- tests_e2e/references/reference_s3_aws_walk.sh_l44 | 6 +++--- tests_e2e/references/reference_select-data.sh_l9 | 6 +++--- tests_e2e/references/reference_string-transform.sh_l61 | 6 +++--- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests_e2e/references/reference_app.sh_l12 b/tests_e2e/references/reference_app.sh_l12 index 8eb0f4c..a7a9425 100644 --- a/tests_e2e/references/reference_app.sh_l12 +++ b/tests_e2e/references/reference_app.sh_l12 @@ -23,7 +23,7 @@ hint: stack trace: github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1072 + graph.go:1089 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_dir-walk.sh_l56 b/tests_e2e/references/reference_dir-walk.sh_l56 index cbec1b2..1359598 100644 --- a/tests_e2e/references/reference_dir-walk.sh_l56 +++ b/tests_e2e/references/reference_dir-walk.sh_l56 @@ -40,11 +40,11 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_error_no_output.sh_l8 b/tests_e2e/references/reference_error_no_output.sh_l8 index b897572..0259b6d 100644 --- a/tests_e2e/references/reference_error_no_output.sh_l8 +++ b/tests_e2e/references/reference_error_no_output.sh_l8 @@ -51,11 +51,11 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_group-error.sh_l8 b/tests_e2e/references/reference_group-error.sh_l8 index 4cab48f..dfef3aa 100644 --- a/tests_e2e/references/reference_group-error.sh_l8 +++ b/tests_e2e/references/reference_group-error.sh_l8 @@ -250,7 +250,7 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 diff --git a/tests_e2e/references/reference_group-port-collision.sh_l13 b/tests_e2e/references/reference_group-port-collision.sh_l13 index fa0a29e..4846360 100644 --- a/tests_e2e/references/reference_group-port-collision.sh_l13 +++ b/tests_e2e/references/reference_group-port-collision.sh_l13 @@ -25,17 +25,17 @@ github.com/actionforge/actrun-cli/nodes.init.40.func1 github.com/actionforge/actrun-cli/core.NewNodeInstance base.go:619 github.com/actionforge/actrun-cli/core.LoadNode - graph.go:640 + graph.go:657 github.com/actionforge/actrun-cli/core.LoadNodes - graph.go:580 + graph.go:597 github.com/actionforge/actrun-cli/core.LoadGraph - graph.go:495 + graph.go:512 github.com/actionforge/actrun-cli/core.RunGraph graph.go:279 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_index.sh_l20 b/tests_e2e/references/reference_index.sh_l20 index 9aac0d2..39898cf 100644 --- a/tests_e2e/references/reference_index.sh_l20 +++ b/tests_e2e/references/reference_index.sh_l20 @@ -84,11 +84,11 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_run-python-embedded.sh_l13 b/tests_e2e/references/reference_run-python-embedded.sh_l13 index 02588a3..dca01ee 100644 --- a/tests_e2e/references/reference_run-python-embedded.sh_l13 +++ b/tests_e2e/references/reference_run-python-embedded.sh_l13 @@ -29,17 +29,17 @@ github.com/actionforge/actrun-cli/nodes.init.51.func1 github.com/actionforge/actrun-cli/core.NewNodeInstance base.go:619 github.com/actionforge/actrun-cli/core.LoadNode - graph.go:640 + graph.go:657 github.com/actionforge/actrun-cli/core.LoadNodes - graph.go:580 + graph.go:597 github.com/actionforge/actrun-cli/core.LoadGraph - graph.go:495 + graph.go:512 github.com/actionforge/actrun-cli/core.RunGraph graph.go:279 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_s3_aws_walk.sh_l22 b/tests_e2e/references/reference_s3_aws_walk.sh_l22 index 7b0d82d..4042e37 100644 --- a/tests_e2e/references/reference_s3_aws_walk.sh_l22 +++ b/tests_e2e/references/reference_s3_aws_walk.sh_l22 @@ -44,11 +44,11 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_s3_aws_walk.sh_l44 b/tests_e2e/references/reference_s3_aws_walk.sh_l44 index 7b0d82d..4042e37 100644 --- a/tests_e2e/references/reference_s3_aws_walk.sh_l44 +++ b/tests_e2e/references/reference_s3_aws_walk.sh_l44 @@ -44,11 +44,11 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_select-data.sh_l9 b/tests_e2e/references/reference_select-data.sh_l9 index 603e11d..61a06c4 100644 --- a/tests_e2e/references/reference_select-data.sh_l9 +++ b/tests_e2e/references/reference_select-data.sh_l9 @@ -91,11 +91,11 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute diff --git a/tests_e2e/references/reference_string-transform.sh_l61 b/tests_e2e/references/reference_string-transform.sh_l61 index 9128334..f5bc3d2 100644 --- a/tests_e2e/references/reference_string-transform.sh_l61 +++ b/tests_e2e/references/reference_string-transform.sh_l61 @@ -51,11 +51,11 @@ github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteImpl github.com/actionforge/actrun-cli/nodes.(*StartNode).ExecuteEntry start@v1.go:45 github.com/actionforge/actrun-cli/core.RunGraph - graph.go:467 + graph.go:484 github.com/actionforge/actrun-cli/core.RunGraphFromString - graph.go:1057 + graph.go:1074 github.com/actionforge/actrun-cli/core.RunGraphFromFile - graph.go:1075 + graph.go:1092 github.com/actionforge/actrun-cli/cmd.cmdRootRun cmd_root.go:186 github.com/spf13/cobra.(*Command).execute