mirror of
https://github.com/supabase/setup-cli.git
synced 2026-09-28 13:45:10 +00:00
fix: allow registry fallback in supported CLI versions
The action currently pins every recent CLI to GHCR, which disables the CLI's registry fallback and leaves image pulls exposed to GHCR throttling. Use the installed CLI version to keep the GHCR default for versions before v2.108.0 and allow fallback for newer versions. Preserve a caller's explicit registry choice and update the bundled v1 action.
This commit is contained in:
9
dist/index.js
generated
vendored
9
dist/index.js
generated
vendored
@@ -60567,6 +60567,11 @@ const determineInstalledVersion = async () => {
|
||||
};
|
||||
|
||||
const CLI_CONFIG_REGISTRY = 'SUPABASE_INTERNAL_IMAGE_REGISTRY';
|
||||
const REGISTRY_VERSION = '1.28.0';
|
||||
const FALLBACK_VERSION = '2.108.0';
|
||||
const shouldPinGhcrRegistry = (installedVersion, configuredRegistry) => !configuredRegistry &&
|
||||
semverExports.gte(installedVersion, REGISTRY_VERSION) &&
|
||||
semverExports.lt(installedVersion, FALLBACK_VERSION);
|
||||
/**
|
||||
* The main function for the action.
|
||||
*
|
||||
@@ -60591,8 +60596,8 @@ async function run() {
|
||||
// Expose installed tool version
|
||||
const determinedVersion = await determineInstalledVersion();
|
||||
setOutput('version', determinedVersion);
|
||||
// Use GHCR mirror by default
|
||||
if (version.toLowerCase() === 'latest' || semverExports.gte(version, '1.28.0')) {
|
||||
// Use GHCR for CLI versions without registry fallback support.
|
||||
if (shouldPinGhcrRegistry(determinedVersion.replace(/^supabase\s+/i, '').replace(/^v/i, ''), process.env[CLI_CONFIG_REGISTRY])) {
|
||||
exportVariable(CLI_CONFIG_REGISTRY, 'ghcr.io');
|
||||
}
|
||||
}
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user