diff --git a/lib/init-action.js b/lib/init-action.js index dbd5a8926..dab7782f8 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -90701,6 +90701,7 @@ exec ${goBinaryPath} "$@"` } finally { logUnwrittenDiagnostics(); } + await saveConfig(config, logger); await sendCompletedStatusReport( startedAt, config, diff --git a/src/config-utils.ts b/src/config-utils.ts index 7bdc29a2e..c84e9ecfc 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -1289,7 +1289,7 @@ export function getPathToParsedConfigFile(tempDir: string): string { /** * Store the given config to the path returned from getPathToParsedConfigFile. */ -async function saveConfig(config: Config, logger: Logger) { +export async function saveConfig(config: Config, logger: Logger) { const configString = JSON.stringify(config); const configFile = getPathToParsedConfigFile(config.tempDir); fs.mkdirSync(path.dirname(configFile), { recursive: true }); diff --git a/src/init-action.ts b/src/init-action.ts index 8c9e2f36b..4e9446b84 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -680,6 +680,12 @@ async function run() { } finally { logUnwrittenDiagnostics(); } + + // We may have updated the config returned from `initConfig`, e.g. to revert + // to `OverlayDatabaseMode.None` if we failed to download an overlay-base + // database. So we save the config again, to ensure that the `analyze` step + // reads the correct config. + await configUtils.saveConfig(config, logger); await sendCompletedStatusReport( startedAt, config,