mirror of
https://github.com/github/codeql-action.git
synced 2025-12-22 23:30:05 +08:00
Store and check action version in Config
This commit is contained in:
13
lib/upload-lib.js
generated
13
lib/upload-lib.js
generated
@@ -89403,7 +89403,18 @@ async function getConfig(tempDir, logger) {
|
||||
const configString = fs7.readFileSync(configFile, "utf8");
|
||||
logger.debug("Loaded config:");
|
||||
logger.debug(configString);
|
||||
return JSON.parse(configString);
|
||||
const config = JSON.parse(configString);
|
||||
if (config.version === void 0) {
|
||||
throw new ConfigurationError(
|
||||
`Loaded configuration file, but it does not contain the expected 'version' field.`
|
||||
);
|
||||
}
|
||||
if (config.version !== getActionVersion()) {
|
||||
throw new ConfigurationError(
|
||||
`Loaded a configuration file for version '${config.version}', but running version '${getActionVersion()}'`
|
||||
);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) {
|
||||
const augmentedConfig = cloneObject(cliConfig);
|
||||
|
||||
Reference in New Issue
Block a user