Put change behind a FF

This commit is contained in:
Michael B. Gale
2026-03-01 15:07:47 +00:00
parent 68d73442fa
commit 8a1cd7656d
16 changed files with 134 additions and 6 deletions
+18 -2
View File
@@ -224,7 +224,19 @@ function isPAT(value: string) {
]);
}
const LANGUAGE_TO_REGISTRY_TYPE: Partial<Record<KnownLanguage, string[]>> = {
type RegistryMapping = Partial<Record<KnownLanguage, string[]>>;
const LANGUAGE_TO_REGISTRY_TYPE: RegistryMapping = {
java: ["maven_repository"],
csharp: ["nuget_feed"],
javascript: ["npm_registry"],
python: ["python_index"],
ruby: ["rubygems_server"],
rust: ["cargo_registry"],
go: ["goproxy_server", "git_source"],
} as const;
const NEW_LANGUAGE_TO_REGISTRY_TYPE: RegistryMapping = {
actions: [],
java: ["maven_repository"],
csharp: ["nuget_feed"],
@@ -268,9 +280,13 @@ export function getCredentials(
registrySecrets: string | undefined,
registriesCredentials: string | undefined,
language: KnownLanguage | undefined,
skipUnusedRegistries: boolean = false,
): Credential[] {
const registryMapping = skipUnusedRegistries
? NEW_LANGUAGE_TO_REGISTRY_TYPE
: LANGUAGE_TO_REGISTRY_TYPE;
const registryTypeForLanguage = language
? LANGUAGE_TO_REGISTRY_TYPE[language]
? registryMapping[language]
: undefined;
let credentialsStr: string;