supabase / setup-cli

A GitHub action for interacting with your Supabase projects using the CLI.
MIT License
107 stars 15 forks source link

Default supabase/cli version and has incompatible changes, easy to accidentally mis-use #269

Open daniel-j-h opened 6 months ago

daniel-j-h commented 6 months ago

This github action by default hard-codes supabase CLI version 1.136.3. Meaning for github actions like the following

uses: supabase/setup-cli@v1
- run: supabase link --project-ref $PROJECT_ID
- run: supabase start

where no

with
  version: ...

is specified explicitly, the supabase cli is on an old release from over a month ago.


We just hit the problem that our own github action was generating types and checking them against the migrations as per

https://supabase.com/docs/guides/cli/github-action/generating-types

but because the type generation changed between supabase v1.136.3 and latest v1.145.4 we got mis-matches such as

-export type Database = {
+export interface Database {

and we didn't hard-code a version in our github action.


That made me think: how can we best make sure that

  1. Type generation works across supabase cli versions or at least developers get notified when using different versions? Maybe you folks have ideas around this topic and maybe this should get discussed in the supabase/cli repo?
  2. The github action uses the latest supabase cli version by default instead of an hard-coded old version

What do you think of e.g. using the current cli version by default or automatically updating the supabase cli version we are using here based on the supabase cli releases?