MCPcopy Create free account
hub / github.com/github/gh-aw / isStatusFunc

Function isStatusFunc

pkg/workflow/expression_optimizer.go:91–101  ·  view source on GitHub ↗

isStatusFunc returns true when node is a call to one of the GitHub Actions status-check functions: always(), success(), failure(), cancelled(). These functions change the execution status of a step/job and must not be removed from an expression by boolean-algebra rules.

(node ConditionNode)

Source from the content-addressed store, hash-verified

89// These functions change the execution status of a step/job and must not be
90// removed from an expression by boolean-algebra rules.
91func isStatusFunc(node ConditionNode) bool {
92 fn, ok := node.(*FunctionCallNode)
93 if !ok {
94 return false
95 }
96 switch fn.FunctionName {
97 case "always", "success", "failure", "cancelled":
98 return true
99 }
100 return false
101}
102
103// nodesEqual returns true when a and b render to identical strings.
104// This is used as a conservative structural-equality test: if two nodes

Callers 2

containsStatusFuncFunction · 0.85
TestIsStatusFuncFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsStatusFuncFunction · 0.68