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)
| 89 | // These functions change the execution status of a step/job and must not be |
| 90 | // removed from an expression by boolean-algebra rules. |
| 91 | func 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 |
no outgoing calls