chore: migrate to esm (#334)

* chore: update unit tests

* fix: follow latest action template

* chore: add licenses and workflows

* chore: remove bloat

* chore: fix linter
This commit is contained in:
Han Qiao
2025-07-23 15:04:43 +08:00
committed by GitHub
parent 6c3c96bfbe
commit b60b5899c7
48 changed files with 40108 additions and 32534 deletions

8
src/index.ts Normal file
View File

@@ -0,0 +1,8 @@
/**
* The entrypoint for the action. This file simply imports and runs the action's
* main logic.
*/
import { run } from './main.js'
/* istanbul ignore next */
run()

View File

@@ -1,11 +1,16 @@
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import gte from 'semver/functions/gte'
import {getDownloadUrl, determineInstalledVersion} from './utils'
import { gte } from 'semver'
import { getDownloadUrl, determineInstalledVersion } from './utils.js'
export const CLI_CONFIG_REGISTRY = 'SUPABASE_INTERNAL_IMAGE_REGISTRY'
async function run(): Promise<void> {
/**
* The main function for the action.
*
* @returns Resolves when the action is complete.
*/
export async function run(): Promise<void> {
try {
// Get version of tool to be installed
const version = core.getInput('version')
@@ -32,5 +37,3 @@ async function run(): Promise<void> {
if (error instanceof Error) core.setFailed(error.message)
}
}
run()

View File

@@ -1,7 +1,7 @@
import {exec} from 'child_process'
import { exec } from 'child_process'
import os from 'os'
import lt from 'semver/functions/lt'
import {promisify} from 'util'
import { lt } from 'semver'
import { promisify } from 'util'
const doExec = promisify(exec)
@@ -37,7 +37,7 @@ export const getDownloadUrl = async (version: string): Promise<string> => {
}
export const determineInstalledVersion = async (): Promise<string> => {
const {stdout} = await doExec('supabase --version')
const { stdout } = await doExec('supabase --version')
const version = stdout.trim()
if (!version) {