mirror of
https://github.com/github/codeql-action.git
synced 2026-05-13 01:10:21 +00:00
Allow explicit disablement too
This commit is contained in:
Generated
+16
-2
@@ -109056,18 +109056,32 @@ function cleanupDatabaseClusterDirectory(config, logger, options = {}, rmSync2 =
|
||||
async function getFileCoverageInformationEnabled(debugMode, repositoryNwo, features, repositoryProperties, logger) {
|
||||
if (debugMode) return true;
|
||||
if (!isAnalyzingPullRequest()) return true;
|
||||
if (process.env["CODEQL_ACTION_ENABLE_FILE_COVERAGE_ON_PRS" /* ENABLE_FILE_COVERAGE_ON_PRS */] === "true") {
|
||||
const envVarValue = process.env["CODEQL_ACTION_ENABLE_FILE_COVERAGE_ON_PRS" /* ENABLE_FILE_COVERAGE_ON_PRS */];
|
||||
if (envVarValue === "true") {
|
||||
logger.info(
|
||||
`File coverage information on pull requests has been enabled by the '${"CODEQL_ACTION_ENABLE_FILE_COVERAGE_ON_PRS" /* ENABLE_FILE_COVERAGE_ON_PRS */}' environment variable. This may increase the time it takes to analyze pull requests, particularly on large repositories.`
|
||||
);
|
||||
return true;
|
||||
}
|
||||
if (repositoryProperties["github-codeql-enable-file-coverage-on-prs" /* ENABLE_FILE_COVERAGE_ON_PRS */] === true) {
|
||||
if (envVarValue === "false") {
|
||||
logger.info(
|
||||
`File coverage information on pull requests has been disabled by the '${"CODEQL_ACTION_ENABLE_FILE_COVERAGE_ON_PRS" /* ENABLE_FILE_COVERAGE_ON_PRS */}' environment variable.`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
const repoPropValue = repositoryProperties["github-codeql-enable-file-coverage-on-prs" /* ENABLE_FILE_COVERAGE_ON_PRS */];
|
||||
if (repoPropValue === true) {
|
||||
logger.info(
|
||||
`File coverage information on pull requests has been enabled by the '${"github-codeql-enable-file-coverage-on-prs" /* ENABLE_FILE_COVERAGE_ON_PRS */}' repository property. This may increase the time it takes to analyze pull requests, particularly on large repositories.`
|
||||
);
|
||||
return true;
|
||||
}
|
||||
if (repoPropValue === false) {
|
||||
logger.info(
|
||||
`File coverage information on pull requests has been disabled by the '${"github-codeql-enable-file-coverage-on-prs" /* ENABLE_FILE_COVERAGE_ON_PRS */}' repository property.`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
if (repositoryNwo.owner !== "github") return true;
|
||||
if (!await features.getValue("skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */)) return true;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user