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

Function buildDetectionSuccessCondition

pkg/workflow/expression_builder.go:273–278  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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.
273func 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

Calls 3

BuildEqualsFunction · 0.85
BuildPropertyAccessFunction · 0.85
BuildStringLiteralFunction · 0.85

Tested by 1