mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
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:
@@ -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 });
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user