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:
Julien Goux
2026-09-24 00:17:25 +02:00
committed by GitHub
parent ab058987d8
commit 8b97e5256c
4 changed files with 37 additions and 37 deletions

9
dist/index.js generated vendored
View File

@@ -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

File diff suppressed because one or more lines are too long