Skip to content

Commit 4e2e64a

Browse files
committed
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.
1 parent 148e76a commit 4e2e64a

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

lib/init-action.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ export function getPathToParsedConfigFile(tempDir: string): string {
12891289
/**
12901290
* Store the given config to the path returned from getPathToParsedConfigFile.
12911291
*/
1292-
async function saveConfig(config: Config, logger: Logger) {
1292+
export async function saveConfig(config: Config, logger: Logger) {
12931293
const configString = JSON.stringify(config);
12941294
const configFile = getPathToParsedConfigFile(config.tempDir);
12951295
fs.mkdirSync(path.dirname(configFile), { recursive: true });

src/init-action.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,12 @@ async function run() {
680680
} finally {
681681
logUnwrittenDiagnostics();
682682
}
683+
684+
// We may have updated the config returned from `initConfig`, e.g. to revert
685+
// to `OverlayDatabaseMode.None` if we failed to download an overlay-base
686+
// database. So we save the config again, to ensure that the `analyze` step
687+
// reads the correct config.
688+
await configUtils.saveConfig(config, logger);
683689
await sendCompletedStatusReport(
684690
startedAt,
685691
config,

0 commit comments

Comments
 (0)