Move code scanning config enablement into feature flags

This commit is contained in:
Henry Mercer
2023-07-19 15:57:59 +01:00
parent bf162c4114
commit 9922e17dbb
27 changed files with 118 additions and 116 deletions

19
lib/feature-flags.js generated
View File

@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Features = exports.FEATURE_FLAGS_FILE_NAME = exports.featureConfig = exports.Feature = void 0;
exports.logCodeScanningConfigInCli = exports.useCodeScanningConfigInCli = exports.Features = exports.FEATURE_FLAGS_FILE_NAME = exports.featureConfig = exports.Feature = void 0;
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const semver = __importStar(require("semver"));
@@ -330,4 +330,21 @@ class GitHubFeatureFlags {
}
}
}
/**
* @returns Whether the Action should generate a code scanning config file
* that gets passed to the CLI.
*/
async function useCodeScanningConfigInCli(codeql, features) {
return await features.getValue(Feature.CliConfigFileEnabled, codeql);
}
exports.useCodeScanningConfigInCli = useCodeScanningConfigInCli;
async function logCodeScanningConfigInCli(codeql, features, logger) {
if (await useCodeScanningConfigInCli(codeql, features)) {
logger.info("Code Scanning configuration file being processed in the codeql CLI.");
}
else {
logger.info("Code Scanning configuration file being processed in the codeql-action.");
}
}
exports.logCodeScanningConfigInCli = logCodeScanningConfigInCli;
//# sourceMappingURL=feature-flags.js.map