mirror of
https://github.com/github/codeql-action.git
synced 2026-05-01 03:10:09 +00:00
Accept replaces-base option
This commit is contained in:
Generated
+13
-2
@@ -122611,8 +122611,18 @@ function getCredentials(logger, registrySecrets, registriesCredentials, language
|
||||
`A ${e.type} private registry is configured for ${e.host || e.url} using a GitHub Personal Access Token (PAT), but no username was provided. This may not work correctly. When configuring a private registry using a PAT, select "Username and password" and enter the username of the user who generated the PAT.`
|
||||
);
|
||||
}
|
||||
const baseCredential = { type: e.type };
|
||||
if (isDefined2(e["replaces-base"])) {
|
||||
if (typeof e["replaces-base"] === "boolean") {
|
||||
baseCredential["replaces-base"] = e["replaces-base"];
|
||||
} else {
|
||||
throw new ConfigurationError(
|
||||
"Invalid credentials - 'replaces-base' must be a boolean"
|
||||
);
|
||||
}
|
||||
}
|
||||
out.push({
|
||||
type: e.type,
|
||||
...baseCredential,
|
||||
...authConfig,
|
||||
...address
|
||||
});
|
||||
@@ -123158,7 +123168,8 @@ async function startProxy(binPath, config, logFilePath, logger) {
|
||||
core13.setOutput("proxy_ca_certificate", config.ca.cert);
|
||||
const registry_urls = config.all_credentials.filter((credential) => credential.url !== void 0).map((credential) => ({
|
||||
type: credential.type,
|
||||
url: credential.url
|
||||
url: credential.url,
|
||||
"replaces-base": credential["replaces-base"]
|
||||
}));
|
||||
core13.setOutput("proxy_urls", JSON.stringify(registry_urls));
|
||||
return { host, port, cert: config.ca.cert, registries: registry_urls };
|
||||
|
||||
@@ -198,6 +198,7 @@ async function startProxy(
|
||||
.map((credential) => ({
|
||||
type: credential.type,
|
||||
url: credential.url,
|
||||
"replaces-base": credential["replaces-base"],
|
||||
}));
|
||||
core.setOutput("proxy_urls", JSON.stringify(registry_urls));
|
||||
|
||||
|
||||
+14
-1
@@ -347,8 +347,21 @@ export function getCredentials(
|
||||
);
|
||||
}
|
||||
|
||||
// Construct the base credential object.
|
||||
const baseCredential: Omit<Registry, keyof Address> = { type: e.type };
|
||||
|
||||
if (isDefined(e["replaces-base"])) {
|
||||
if (typeof e["replaces-base"] === "boolean") {
|
||||
baseCredential["replaces-base"] = e["replaces-base"];
|
||||
} else {
|
||||
throw new ConfigurationError(
|
||||
"Invalid credentials - 'replaces-base' must be a boolean",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
out.push({
|
||||
type: e.type,
|
||||
...baseCredential,
|
||||
...authConfig,
|
||||
...address,
|
||||
});
|
||||
|
||||
@@ -246,6 +246,8 @@ export function credentialToStr(credential: Credential): string {
|
||||
export type Registry = {
|
||||
/** The type of the package registry. */
|
||||
type: string;
|
||||
/** Whether the registry replaces the base registry for the ecosystem. */
|
||||
"replaces-base"?: boolean;
|
||||
} & Address;
|
||||
|
||||
// If a registry has an `url`, then that takes precedence over the `host` which may or may
|
||||
|
||||
Reference in New Issue
Block a user