Skip to content

Commit 70d5ccc

Browse files
committed
Disable TRAP caching when conditions met
1 parent b04e63f commit 70d5ccc

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/init-action.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,8 @@ async function validateOverlayDatabaseMode(
999999
}
10001000

10011001
async function isTrapCachingEnabled(
1002-
_features: FeatureEnablement,
1003-
_overlayDatabaseMode: OverlayDatabaseMode,
1002+
features: FeatureEnablement,
1003+
overlayDatabaseMode: OverlayDatabaseMode,
10041004
): Promise<boolean> {
10051005
// If the workflow specified something always respect that
10061006
const trapCaching = getOptionalInput("trap-caching");
@@ -1009,6 +1009,15 @@ async function isTrapCachingEnabled(
10091009
// On self-hosted runners which may have slow network access, disable TRAP caching by default
10101010
if (!isHostedRunner()) return false;
10111011

1012+
// If overlay analysis is enabled, then disable TRAP caching since overlay analysis supersedes it.
1013+
// This change is gated behind a feature flag.
1014+
if (
1015+
overlayDatabaseMode !== OverlayDatabaseMode.None &&
1016+
(await features.getValue(Feature.OverlayAnalysisDisableTrapCaching))
1017+
) {
1018+
return false;
1019+
}
1020+
10121021
// Otherwise, enable TRAP caching
10131022
return true;
10141023
}

0 commit comments

Comments
 (0)