@@ -1103,8 +1103,11 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
11031103 ) ;
11041104 }
11051105
1106+ // Construct a `Config` from the inputs to the action.
1107+ // This does not consider the `UserConfig` (if any).
11061108 const config = await getDefaultConfig ( inputs ) ;
1107- const augmentationProperties = config . augmentationProperties ;
1109+
1110+ // Store the `UserConfig` (if any) in the `Config`.
11081111 config . originalUserInput = userConfig ;
11091112
11101113 // The choice of overlay database mode depends on the selection of languages
@@ -1119,15 +1122,16 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
11191122 config . languages ,
11201123 inputs . sourceRoot ,
11211124 config . buildMode ,
1122- generateCodeScanningConfig ( userConfig , augmentationProperties ) ,
1125+ generateCodeScanningConfig ( userConfig , config . augmentationProperties ) ,
11231126 logger ,
11241127 ) ;
11251128 logger . info (
11261129 `Using overlay database mode: ${ overlayDatabaseMode } ` +
11271130 `${ useOverlayDatabaseCaching ? "with" : "without" } caching.` ,
11281131 ) ;
1129- augmentationProperties . overlayDatabaseMode = overlayDatabaseMode ;
1130- augmentationProperties . useOverlayDatabaseCaching = useOverlayDatabaseCaching ;
1132+ config . augmentationProperties . overlayDatabaseMode = overlayDatabaseMode ;
1133+ config . augmentationProperties . useOverlayDatabaseCaching =
1134+ useOverlayDatabaseCaching ;
11311135
11321136 if (
11331137 overlayDatabaseMode === OverlayDatabaseMode . Overlay ||
@@ -1137,7 +1141,7 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
11371141 logger ,
11381142 ) )
11391143 ) {
1140- augmentationProperties . extraQueryExclusions . push ( {
1144+ config . augmentationProperties . extraQueryExclusions . push ( {
11411145 exclude : { tags : "exclude-from-incremental" } ,
11421146 } ) ;
11431147 }
@@ -1424,7 +1428,8 @@ export function generateCodeScanningConfig(
14241428 originalUserInput : UserConfig ,
14251429 augmentationProperties : AugmentationProperties ,
14261430) : UserConfig {
1427- // make a copy so we can modify it
1431+ // Make a copy of the `UserConfig` so we can modify it without mutating
1432+ // the original input.
14281433 const augmentedConfig = cloneObject ( originalUserInput ) ;
14291434
14301435 // Inject the queries from the input
0 commit comments