fix: inverted conditional for semver check (#129)

* fix: inverted conditional for semver check

* chore: add tests for default version

* chore: parse default action input

* chore: update binary files

* chore: fix unit test
This commit is contained in:
Han Qiao
2023-01-30 18:38:33 +08:00
committed by GitHub
parent d7405cc5a0
commit 9a74081b27
6 changed files with 47 additions and 8 deletions

View File

@@ -1,8 +1,10 @@
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import gte from 'semver/functions/lt'
import gte from 'semver/functions/gte'
import {getDownloadUrl} from './utils'
export const CLI_CONFIG_REGISTRY = 'SUPABASE_INTERNAL_IMAGE_REGISTRY'
async function run(): Promise<void> {
try {
// Get version of tool to be installed
@@ -20,7 +22,7 @@ async function run(): Promise<void> {
// Use GHCR mirror by default
if (version.toLowerCase() === 'latest' || gte(version, '1.28.0')) {
core.exportVariable('SUPABASE_INTERNAL_IMAGE_REGISTRY', 'ghcr.io')
core.exportVariable(CLI_CONFIG_REGISTRY, 'ghcr.io')
}
} catch (error) {
if (error instanceof Error) core.setFailed(error.message)