buildDetectionPassedCondition builds the condition to check if the detection job either succeeded (no threats found) or was skipped (agent produced no outputs or patch — nothing to detect against). Use this for downstream jobs that must run in both cases.
()
| 281 | // succeeded (no threats found) or was skipped (agent produced no outputs or patch — nothing |
| 282 | // to detect against). Use this for downstream jobs that must run in both cases. |
| 283 | func buildDetectionPassedCondition() ConditionNode { |
| 284 | return BuildOr( |
| 285 | buildDetectionSuccessCondition(), |
| 286 | BuildEquals( |
| 287 | BuildPropertyAccess(fmt.Sprintf("needs.%s.result", constants.DetectionJobName)), |
| 288 | BuildStringLiteral("skipped"), |
| 289 | ), |
| 290 | ) |
| 291 | } |
| 292 | |
| 293 | // Helper functions for building common GitHub Actions expression patterns |
| 294 |
no test coverage detected