@@ -622,18 +622,29 @@ class GitHubFeatureFlags {
622
622
try {
623
623
const featuresToRequest = Object . entries ( featureConfig )
624
624
. filter ( ( [ , config ] ) => ! config . legacyApi )
625
- . map ( ( [ f ] ) => f )
626
- . join ( "," ) ;
627
-
628
- const response = await getApiClient ( ) . request (
629
- "GET /repos/:owner/:repo/code-scanning/codeql-action/features" ,
630
- {
631
- owner : this . repositoryNwo . owner ,
632
- repo : this . repositoryNwo . repo ,
633
- features : featuresToRequest ,
634
- } ,
635
- ) ;
636
- const remoteFlags = response . data as GitHubFeatureFlagsApiResponse ;
625
+ . map ( ( [ f ] ) => f ) ;
626
+
627
+ const FEATURES_PER_REQUEST = 25 ;
628
+ const featureChunks : string [ ] [ ] = [ ] ;
629
+ while ( featuresToRequest . length > 0 ) {
630
+ featureChunks . push ( featuresToRequest . splice ( 0 , FEATURES_PER_REQUEST ) ) ;
631
+ }
632
+
633
+ let remoteFlags : GitHubFeatureFlagsApiResponse = { } ;
634
+
635
+ for ( const chunk of featureChunks ) {
636
+ const response = await getApiClient ( ) . request (
637
+ "GET /repos/:owner/:repo/code-scanning/codeql-action/features" ,
638
+ {
639
+ owner : this . repositoryNwo . owner ,
640
+ repo : this . repositoryNwo . repo ,
641
+ features : chunk . join ( "," ) ,
642
+ } ,
643
+ ) ;
644
+ const chunkFlags = response . data as GitHubFeatureFlagsApiResponse ;
645
+ remoteFlags = { ...remoteFlags , ...chunkFlags } ;
646
+ }
647
+
637
648
this . logger . debug (
638
649
"Loaded the following default values for the feature flags from the Code Scanning API:" ,
639
650
) ;
0 commit comments