You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
actions/setup/sh/conclude_threat_detection.sh exits non-zero on a strict-mode infrastructure failure without writing any step outputs, which makes an infra failure render to reviewers as [!CAUTION] agentic threat detected. This is exactly the confusion #48940 set out to eliminate; the fix landed in the .cjs path and never covered the shell path.
This is a live bug, independent of the external-detector workstream. It needs no new binary and no coordination with gh-aw-threat-detection.
While in there: the warn-mode branch writes step outputs but does not export GH_AW_DETECTION_CONCLUSION / GH_AW_DETECTION_REASON to $GITHUB_ENV, unlike setDetectionFailure in parse_threat_detection_results.cjs. That is inconsistent for any later step inside the detection job. Export them in both branches.
Acceptance criteria
Strict-mode missing-result-file path writes conclusion=failure, success=false, reason=agent_failure to $GITHUB_OUTPUT before exit 1.
Both the warn and strict branches export GH_AW_DETECTION_CONCLUSION / GH_AW_DETECTION_REASON to $GITHUB_ENV.
Test coverage in pkg/workflow/threat_detection_conclude_script_test.go asserting the outputs in strict mode.
make recompile.
Relationship to the delegation issue
The follow-on work in this workstream deletes these branches entirely and delegates to threat-detect conclude. This issue should still land now rather than waiting — the delegation change carries more risk and depends on the v0.4.0 pin, and per the upstream note the bug is worth fixing on its own timeline.
Summary
actions/setup/sh/conclude_threat_detection.shexits non-zero on a strict-mode infrastructure failure without writing any step outputs, which makes an infra failure render to reviewers as[!CAUTION] agentic threat detected. This is exactly the confusion #48940 set out to eliminate; the fix landed in the.cjspath and never covered the shell path.This is a live bug, independent of the external-detector workstream. It needs no new binary and no coordination with
gh-aw-threat-detection.Current code
actions/setup/sh/conclude_threat_detection.shlines 35-43:Failure chain
GH_AW_DETECTION_CONTINUE_ON_ERROR=false) + missingdetection_result.json→exit 1with nothing appended to$GITHUB_OUTPUT.needs.detection.outputs.detection_reasonis the empty string.actions/setup/js/threat_detection_warning.cjs,isToolingFailureReason("")→false, so the engine-error branch from fix: use [!WARNING] banner for threat detection engine failures instead of [!CAUTION] #48940 is not taken.getDetectionReasonText("")falls through to the generic "The threat detection analysis could not be completed."[!CAUTION] agentic threat detected.Proposed fix
Write the outputs before failing:
While in there: the warn-mode branch writes step outputs but does not export
GH_AW_DETECTION_CONCLUSION/GH_AW_DETECTION_REASONto$GITHUB_ENV, unlikesetDetectionFailureinparse_threat_detection_results.cjs. That is inconsistent for any later step inside the detection job. Export them in both branches.Acceptance criteria
conclusion=failure,success=false,reason=agent_failureto$GITHUB_OUTPUTbeforeexit 1.GH_AW_DETECTION_CONCLUSION/GH_AW_DETECTION_REASONto$GITHUB_ENV.pkg/workflow/threat_detection_conclude_script_test.goasserting the outputs in strict mode.make recompile.Relationship to the delegation issue
The follow-on work in this workstream deletes these branches entirely and delegates to
threat-detect conclude. This issue should still land now rather than waiting — the delegation change carries more risk and depends on thev0.4.0pin, and per the upstream note the bug is worth fixing on its own timeline.References
threat-detect conclude, with divergent (and partly broken) semantics gh-aw-threat-detection#694