buildDetectionSuccessCondition builds the condition to check if detection passed. Detection runs in a separate detection job that only succeeds (result == 'success') when the analysis worked, the output was parsed, and no threats were found. When threats are detected the detection job exits with a n
()
| 271 | // the analysis worked, the output was parsed, and no threats were found. When threats are |
| 272 | // detected the detection job exits with a non-zero code, giving it a 'failure' result. |
| 273 | func buildDetectionSuccessCondition() ConditionNode { |
| 274 | return BuildEquals( |
| 275 | BuildPropertyAccess(fmt.Sprintf("needs.%s.result", constants.DetectionJobName)), |
| 276 | BuildStringLiteral("success"), |
| 277 | ) |
| 278 | } |
| 279 | |
| 280 | // buildDetectionPassedCondition builds the condition to check if the detection job either |
| 281 | // succeeded (no threats found) or was skipped (agent produced no outputs or patch — nothing |