From 3592fe5d7ace9525afa253e19223d54e95eacd8d Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 9 Mar 2026 17:32:57 +0000 Subject: [PATCH] Address review comments --- CHANGELOG.md | 2 +- lib/init-action.js | 2 +- src/init-action.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf2f02301..e6e88d35e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th ## [UNRELEASED] - Fixed [a bug](https://github.com/github/codeql-action/issues/3555) which caused the CodeQL Action to fail loading repository properties if a "Multi select" repository property was configured for the repository. [#3557](https://github.com/github/codeql-action/pull/3557) -- Added an experimental change which skips collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed when analyzing the default branch and protected branches. +- Added an experimental change which skips collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses. Repositories owned by an organization can opt out of this change by creating a custom repository property with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then setting this property to `true` in the repository's settings. For more information, see [Managing custom properties for repositories in your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). diff --git a/lib/init-action.js b/lib/init-action.js index bcf110f6a..42df557b7 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -109761,7 +109761,7 @@ async function run(startedAt) { ) ); } - if (config.enableFileCoverageInformation && isAnalyzingPullRequest() && repositoryPropertiesResult.orElse({})["github-codeql-file-coverage-on-prs" /* FILE_COVERAGE_ON_PRS */] === true) { + if (config.enableFileCoverageInformation && isAnalyzingPullRequest() && await features.getValue("skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */, codeql) && repositoryPropertiesResult.orElse({})["github-codeql-file-coverage-on-prs" /* FILE_COVERAGE_ON_PRS */] === true) { addNoLanguageDiagnostic( config, makeTelemetryDiagnostic( diff --git a/src/init-action.ts b/src/init-action.ts index 3b673723a..d64832b73 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -403,6 +403,7 @@ async function run(startedAt: Date) { if ( config.enableFileCoverageInformation && isAnalyzingPullRequest() && + (await features.getValue(Feature.SkipFileCoverageOnPrs, codeql)) && repositoryPropertiesResult.orElse({})[ RepositoryPropertyName.FILE_COVERAGE_ON_PRS ] === true