mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Move extraQueryExclusions out of AugmentationProperties
This commit is contained in:
29
lib/resolve-environment-action.js
generated
29
lib/resolve-environment-action.js
generated
@@ -77720,6 +77720,9 @@ function checkActionVersion(version, githubVersion) {
|
||||
}
|
||||
}
|
||||
}
|
||||
function cloneObject(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
async function checkSipEnablement(logger) {
|
||||
if (process.env["CODEQL_ACTION_IS_SIP_ENABLED" /* IS_SIP_ENABLED */] !== void 0 && ["true", "false"].includes(process.env["CODEQL_ACTION_IS_SIP_ENABLED" /* IS_SIP_ENABLED */])) {
|
||||
return process.env["CODEQL_ACTION_IS_SIP_ENABLED" /* IS_SIP_ENABLED */] === "true";
|
||||
@@ -78690,6 +78693,24 @@ async function getConfig(tempDir, logger) {
|
||||
logger.debug(configString);
|
||||
return JSON.parse(configString);
|
||||
}
|
||||
function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) {
|
||||
if (extraQueryExclusions.length === 0) {
|
||||
return cliConfig;
|
||||
}
|
||||
const augmentedConfig = cloneObject(cliConfig);
|
||||
augmentedConfig["query-filters"] = [
|
||||
// Ordering matters. If the first filter is an inclusion, it implicitly
|
||||
// excludes all queries that are not included. If it is an exclusion,
|
||||
// it implicitly includes all queries that are not excluded. So user
|
||||
// filters (if any) should always be first to preserve intent.
|
||||
...augmentedConfig["query-filters"] || [],
|
||||
...extraQueryExclusions
|
||||
];
|
||||
if (augmentedConfig["query-filters"]?.length === 0) {
|
||||
delete augmentedConfig["query-filters"];
|
||||
}
|
||||
return augmentedConfig;
|
||||
}
|
||||
|
||||
// src/codeql.ts
|
||||
var fs4 = __toESM(require("fs"));
|
||||
@@ -79225,13 +79246,17 @@ async function runCli(cmd, args = [], opts = {}) {
|
||||
}
|
||||
async function writeCodeScanningConfigFile(config, logger) {
|
||||
const codeScanningConfigFile = getGeneratedCodeScanningConfigPath(config);
|
||||
const augmentedConfig = appendExtraQueryExclusions(
|
||||
config.extraQueryExclusions,
|
||||
config.computedConfig
|
||||
);
|
||||
logger.info(
|
||||
`Writing augmented user configuration file to ${codeScanningConfigFile}`
|
||||
);
|
||||
logger.startGroup("Augmented user configuration file contents");
|
||||
logger.info(dump(config.computedConfig));
|
||||
logger.info(dump(augmentedConfig));
|
||||
logger.endGroup();
|
||||
fs4.writeFileSync(codeScanningConfigFile, dump(config.computedConfig));
|
||||
fs4.writeFileSync(codeScanningConfigFile, dump(augmentedConfig));
|
||||
return codeScanningConfigFile;
|
||||
}
|
||||
var TRAP_CACHE_SIZE_MB = 1024;
|
||||
|
||||
Reference in New Issue
Block a user