@@ -646,6 +646,23 @@ function parseQueriesFromInput(
646
646
return trimmedInput . split ( "," ) . map ( ( query ) => ( { uses : query . trim ( ) } ) ) ;
647
647
}
648
648
649
+ async function isOverlayAnalysisFeatureEnabled (
650
+ repository : RepositoryNwo ,
651
+ features : FeatureEnablement ,
652
+ codeql : CodeQL ,
653
+ ) : Promise < boolean > {
654
+ // TODO: Remove the repository owner check once support for overlay analysis
655
+ // stabilizes, and no more backward-incompatible changes are expected.
656
+ if ( ! [ "github" , "dsp-testing" ] . includes ( repository . owner ) ) {
657
+ return false ;
658
+ }
659
+ if ( ! ( await features . getValue ( Feature . OverlayAnalysis , codeql ) ) ) {
660
+ return false ;
661
+ }
662
+ // TODO: Add per-language feature checks here
663
+ return true ;
664
+ }
665
+
649
666
/**
650
667
* Calculate and validate the overlay database mode and caching to use.
651
668
*
@@ -696,10 +713,7 @@ export async function getOverlayDatabaseMode(
696
713
"from the CODEQL_OVERLAY_DATABASE_MODE environment variable." ,
697
714
) ;
698
715
} else if (
699
- // TODO: Remove the repository owner check once support for overlay analysis
700
- // stabilizes, and no more backward-incompatible changes are expected.
701
- [ "github" , "dsp-testing" ] . includes ( repository . owner ) &&
702
- ( await features . getValue ( Feature . OverlayAnalysis , codeql ) )
716
+ await isOverlayAnalysisFeatureEnabled ( repository , features , codeql )
703
717
) {
704
718
if ( isAnalyzingPullRequest ( ) ) {
705
719
overlayDatabaseMode = OverlayDatabaseMode . Overlay ;
0 commit comments