Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Accept replaces-base option
  • Loading branch information
mbg committed Apr 25, 2026
commit efdcb31f11520a0f75acffe6ab513bc602f26e8c
15 changes: 13 additions & 2 deletions lib/start-proxy-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/start-proxy-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
15 changes: 14 additions & 1 deletion src/start-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Comment thread
mbg marked this conversation as resolved.
throw new ConfigurationError(
Comment thread
mbg marked this conversation as resolved.
Outdated
"Invalid credentials - 'replaces-base' must be a boolean",
);
}
}

out.push({
type: e.type,
...baseCredential,
...authConfig,
...address,
});
Expand Down
2 changes: 2 additions & 0 deletions src/start-proxy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down