From e0af356cbcc1c97aaf7bade0fcad5ddbe6357ec1 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 2 Mar 2026 20:04:08 +0100 Subject: [PATCH] Remove restriction to `github` org --- src/init-action.ts | 1 - src/init.test.ts | 25 ------------------------- src/init.ts | 5 ----- 3 files changed, 31 deletions(-) diff --git a/src/init-action.ts b/src/init-action.ts index f238361e4..de15c2d05 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -378,7 +378,6 @@ async function run(startedAt: Date) { repositoryProperties: repositoryPropertiesResult.orElse({}), enableFileCoverageInformation: await getFileCoverageInformationEnabled( debugMode, - repositoryNwo, features, repositoryPropertiesResult.orElse({}), logger, diff --git a/src/init.test.ts b/src/init.test.ts index 2c81e7eb8..ff560a611 100644 --- a/src/init.test.ts +++ b/src/init.test.ts @@ -16,7 +16,6 @@ import { } from "./init"; import { KnownLanguage } from "./languages"; import { getRunnerLogger } from "./logging"; -import { parseRepositoryNwo } from "./repository"; import { createFeatures, LoggedMessage, @@ -456,7 +455,6 @@ test("file coverage information enabled when debugMode is true", async (t) => { t.true( await getFileCoverageInformationEnabled( true, // debugMode - parseRepositoryNwo("github/codeql-action"), createFeatures([Feature.SkipFileCoverageOnPrs]), {}, getRunnerLogger(true), @@ -470,21 +468,6 @@ test("file coverage information enabled when not analyzing a pull request", asyn t.true( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("github/codeql-action"), - createFeatures([Feature.SkipFileCoverageOnPrs]), - {}, - getRunnerLogger(true), - ), - ); -}); - -test("file coverage information enabled when owner is not 'github'", async (t) => { - sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true); - - t.true( - await getFileCoverageInformationEnabled( - false, // debugMode - parseRepositoryNwo("other-org/some-repo"), createFeatures([Feature.SkipFileCoverageOnPrs]), {}, getRunnerLogger(true), @@ -498,7 +481,6 @@ test("file coverage information enabled when feature flag is not enabled", async t.true( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("github/codeql-action"), createFeatures([]), {}, getRunnerLogger(true), @@ -512,7 +494,6 @@ test("file coverage information disabled when all conditions for skipping are me t.false( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("github/codeql-action"), createFeatures([Feature.SkipFileCoverageOnPrs]), {}, getRunnerLogger(true), @@ -529,7 +510,6 @@ test("file coverage information enabled when repository property enables it on P t.true( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("github/codeql-action"), createFeatures([Feature.SkipFileCoverageOnPrs]), { [RepositoryPropertyName.ENABLE_FILE_COVERAGE_ON_PRS]: true, @@ -561,7 +541,6 @@ test("file coverage information enabled when env var enables it on PRs", async ( t.true( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("github/codeql-action"), createFeatures([Feature.SkipFileCoverageOnPrs]), {}, logger, @@ -591,7 +570,6 @@ test("file coverage information disabled when env var disables it on PRs", async t.false( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("other-org/some-repo"), createFeatures([]), {}, logger, @@ -618,7 +596,6 @@ test("file coverage information disabled when repository property disables it on t.false( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("other-org/some-repo"), createFeatures([]), { [RepositoryPropertyName.ENABLE_FILE_COVERAGE_ON_PRS]: false, @@ -653,7 +630,6 @@ test("file coverage env var 'false' takes precedence over repository property 't t.false( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("github/codeql-action"), createFeatures([Feature.SkipFileCoverageOnPrs]), { [RepositoryPropertyName.ENABLE_FILE_COVERAGE_ON_PRS]: true, @@ -695,7 +671,6 @@ test("file coverage env var takes precedence over repository property", async (t t.true( await getFileCoverageInformationEnabled( false, // debugMode - parseRepositoryNwo("github/codeql-action"), createFeatures([Feature.SkipFileCoverageOnPrs]), { [RepositoryPropertyName.ENABLE_FILE_COVERAGE_ON_PRS]: true, diff --git a/src/init.ts b/src/init.ts index f0fa2c05e..5ab1ac854 100644 --- a/src/init.ts +++ b/src/init.ts @@ -25,7 +25,6 @@ import { } from "./feature-flags/properties"; import { KnownLanguage, Language } from "./languages"; import { Logger, withGroupAsync } from "./logging"; -import { RepositoryNwo } from "./repository"; import { ToolsSource } from "./setup-codeql"; import { ZstdAvailability } from "./tar"; import { ToolsDownloadStatusReport } from "./tools-download"; @@ -305,7 +304,6 @@ export function cleanupDatabaseClusterDirectory( export async function getFileCoverageInformationEnabled( debugMode: boolean, - repositoryNwo: RepositoryNwo, features: FeatureEnablement, repositoryProperties: RepositoryProperties, logger: Logger, @@ -359,9 +357,6 @@ export async function getFileCoverageInformationEnabled( return false; } - // For now, restrict this feature to the GitHub org - if (repositoryNwo.owner !== "github") return true; - if (!(await features.getValue(Feature.SkipFileCoverageOnPrs))) return true; return false;