@@ -263,6 +263,8 @@ async function main() {
263263 const logPath = path . join ( threatDetectionDir , DETECTION_LOG_FILENAME ) ;
264264 const runDetection = process . env . RUN_DETECTION ;
265265 const continueOnError = process . env . GH_AW_DETECTION_CONTINUE_ON_ERROR !== "false" ;
266+ const detectionExecutionOutcome = process . env . DETECTION_AGENTIC_EXECUTION_OUTCOME || "" ;
267+ const detectionExecutionFailed = detectionExecutionOutcome === "failure" ;
266268 const isWarnMode = continueOnError ;
267269
268270 /**
@@ -273,8 +275,9 @@ async function main() {
273275 * @param {string } message - Human-readable error message
274276 */
275277 function setDetectionFailure ( reason , message ) {
278+ const mustFail = detectionExecutionFailed && ( reason === "agent_failure" || reason === "parse_error" ) ;
276279 core . setOutput ( "reason" , reason ) ;
277- if ( isWarnMode ) {
280+ if ( isWarnMode && ! mustFail ) {
278281 core . warning ( `⚠️ ${ message } ` ) ;
279282 core . setOutput ( "conclusion" , "warning" ) ;
280283 core . setOutput ( "success" , "false" ) ;
@@ -309,6 +312,7 @@ async function main() {
309312 core . info ( "════════════════════════════════════════════════════════" ) ;
310313 core . info ( `📋 RUN_DETECTION env: ${ JSON . stringify ( runDetection ) } ` ) ;
311314 core . info ( `📋 continue-on-error: ${ continueOnError } ` ) ;
315+ core . info ( `📋 detection execution outcome: ${ JSON . stringify ( detectionExecutionOutcome ) } ` ) ;
312316 core . info ( `📁 Threat detection directory: ${ threatDetectionDir } ` ) ;
313317 core . info ( `📄 Detection log path: ${ logPath } ` ) ;
314318
0 commit comments