From e3cd8ff5aca13f22fb1ec190aefdcd7e14356fd2 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 9 Jun 2026 08:30:42 +0000 Subject: [PATCH] fix(COD-7115): always run IaC on the target branch --- src/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 83a8bd78..343449b4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,9 +18,8 @@ import { generateCacheKey, } from './util' -// Global scanner toggles - set to false to disable a scanner globally +// Set to false to disable SCA globally const enableScaRunning = true -let enableIacRunning = false async function runAnalysis() { const target = getInput('target') @@ -55,9 +54,10 @@ async function runAnalysis() { } // Skip the IaC scan if there no IaC-related files have been modified in the PR + let enableIacRunning = true if (modifiedFiles && target == 'new') { - if (shouldRunIaCScanner(modifiedFiles)) { - enableIacRunning = true + if (!shouldRunIaCScanner(modifiedFiles)) { + enableIacRunning = false } } @@ -171,6 +171,8 @@ async function runAnalysis() { } async function displayResults() { + const enableIacRunning = true + info('Displaying results') // Download artifacts from previous jobs