mirror of
https://github.com/github/codeql-action.git
synced 2026-05-12 17:00:15 +00:00
Add env var to enable file coverage on PRs
This commit is contained in:
Generated
+8
-1
@@ -110807,7 +110807,14 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir
|
||||
}
|
||||
if (!config.enableFileCoverageInformation) {
|
||||
const isOrgOwned = github2.context.payload.repository?.owner.type === "Organization";
|
||||
const reenableMessage = isOrgOwned ? ` To enable file coverage information on pull requests, set the '${"github-codeql-enable-file-coverage-on-prs" /* ENABLE_FILE_COVERAGE_ON_PRS */}' repository property to 'true'.` : "";
|
||||
let reenableMessage;
|
||||
if (isOrgOwned) {
|
||||
reenableMessage = ` To enable file coverage information on pull requests, set the '${"github-codeql-enable-file-coverage-on-prs" /* ENABLE_FILE_COVERAGE_ON_PRS */}' repository property to 'true'.`;
|
||||
} else if (!isDefaultSetup()) {
|
||||
reenableMessage = ` To enable file coverage information on pull requests, set the '${"CODEQL_ACTION_ENABLE_FILE_COVERAGE_ON_PRS" /* ENABLE_FILE_COVERAGE_ON_PRS */}' environment variable to 'true'.`;
|
||||
} else {
|
||||
reenableMessage = "";
|
||||
}
|
||||
logger.info(
|
||||
`To speed up pull request analysis, file coverage information is only enabled when analyzing the default branch and protected branches.${reenableMessage}`
|
||||
);
|
||||
|
||||
Generated
+7
-1
@@ -109056,9 +109056,15 @@ 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") {
|
||||
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) {
|
||||
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 will increase the time it takes to analyze pull requests, particularly on large repositories.`
|
||||
`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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user