Skip to content
2 changes: 0 additions & 2 deletions .github/workflows/graphs/build-test-publish.act
Original file line number Diff line number Diff line change
Expand Up @@ -2172,12 +2172,10 @@ nodes:
plum-kiwano-lobster: dev.actionforge.actrun
coral-dragonfruit-jackfruit: ''
persimmon-date-coral: distribution.xml
blackberry-apricot-butterfly: 'Developer ID Installer: Actionforge Inc. (D9L94G8QN4)'
grape-peach-apricot: 1.0.0
goose-goat-indigo: ''
guava-boysenberry-hippopotamus: ''
strawberry-nectarine-seahorse: actrun-cli.pkg
pomegranate-cranberry-gold: actrun-cli.pkg
graph:
entry: group-inputs-v1-kiwano-peach-horse
type: group
Expand Down
16 changes: 15 additions & 1 deletion cmd/cmd_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ func validateGraph(filePath string) error {
hasErrors = true
}

_, errs := core.LoadGraph(graphYaml, nil, "", true, core.RunOpts{})
opts := core.RunOpts{
VS: &core.ValidationState{},
OverrideSecrets: make(map[string]string),
}
if ghToken := u.GetGhTokenFromEnv(); ghToken != "" {
opts.OverrideSecrets["GITHUB_TOKEN"] = ghToken
}
_, errs := core.LoadGraph(graphYaml, nil, "", opts)

if len(errs) > 0 {
fmt.Printf("\n❌ Graph validation failed with %d error(s):\n", len(errs))
Expand All @@ -132,6 +139,13 @@ func validateGraph(filePath string) error {
hasErrors = true
}

if len(opts.VS.Warnings) > 0 {
fmt.Printf("\n⚠️ %d warning(s):\n", len(opts.VS.Warnings))
for i, w := range opts.VS.Warnings {
fmt.Printf(" %d. %s\n", i+1, w)
}
}

if hasErrors {
return fmt.Errorf("validation failed")
}
Expand Down
20 changes: 13 additions & 7 deletions core/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ type NodeBaseInterface interface {
// Base component for nodes that offer values from other nodes.
// The node that implements this component has outgoing connections.
type NodeBaseComponent struct {
Name string // Human readable name of the node
Label string // Label of the node shown in the graph editor
Id string // Unique identifier for the node
FullPath string // Full path of the node within the graph hierarchy
CacheId string // Unique identifier for the cache
NodeType string // Node type of the node (e.g. core/run@v1 or github.com/actions/checkout@v3)
Name string // Human readable name of the node
Label string // Label of the node shown in the graph editor
Id string // Unique identifier for the node
FullPath string // Full path of the node within the graph hierarchy
CacheId string // Unique identifier for the cache
NodeType string // Node type of the node (e.g. core/run@v1 or github.com/actions/checkout@v3)
Graph *ActionGraph
Parent NodeBaseInterface
isExecutionNode bool
Expand Down Expand Up @@ -605,7 +605,13 @@ func NewGhActionNode(nodeType string, parent NodeBaseInterface, parentId string,

node, errs := factoryEntry.FactoryFn(nodeType, parent, parentId, nil, validate, opts)
if len(errs) > 0 {
return nil, errs
if node == nil {
return nil, errs
}
// Factory returned a valid node with warnings/errors (e.g. validation
// proxy). Initialise the node and pass the errors through.
utils.InitMapAndSliceInStructRecursively(reflect.ValueOf(node))
return node, errs
}

utils.InitMapAndSliceInStructRecursively(reflect.ValueOf(node))
Expand Down
Loading
Loading