init-action: save updated config

This commit updates the init action to save the config again at the end
of run(), so that config updates in run() are correctly propagated to
the analyze action.
This commit is contained in:
Chuan-kai Lin
2025-09-11 08:07:50 -07:00
parent 148e76abb6
commit 4e2e64a92a
3 changed files with 8 additions and 1 deletions

View File

@@ -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 });

View File

@@ -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,