Replies: 1 comment 1 reply
-
|
I too need to know about the proper workflow for supabase, but just wanted to mention that you don't need a husky pre commit hook for your hacky workaround. Git has |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, my question is regarding the version control for
config.tomlfile when we set up supabase for local development. More specifically, this file is not ignored in the.gitignoreby default so I guess it is meant to be pushed to the repository? However, I have a problem with it once it is pushed up.I have github actions set up to automatically deploy supabase changes to preview and production DB. So when
config.tomlis pushed to repository, its changes will be visible to the Github actions. However, in my case, I have set up Google OAUTH for my app so I have putenv(SUPABASE_GOOGLE_OAUTH_CLIENT_ID)andenv(SUPABASE_GOOGLE_OAUTH_CLIENT_SECRET)inside theconfig.tomlfile, which are only meant to be visible when running locally in my computer. So I put those env variables inside.envfile as instructed in supabase official site. However, sinceconfig.tomlis pushed, when my preview or production pipeline try to run the supabase deployment flow, e.g.supabase db push, it will try to read thisconfig.tomlfor some reason and tells me that theenv(SUPABASE_GOOGLE_OAUTH_CLIENT_ID)cannot be resolved, because I didn't set them up (obviously) in the github workflow environment.But the point is, these env variables are meant for local only, so I don't want to add them into the github actions secret. Then how should I do it properly? Does anyone encounter this before and what's your solution or workaround for this? I'm excited to learn how yall do it and learn from the best practice.
In my case, my current workaround is kind of hacky, I use Husky to run a pre-commit hook that unstaged the committed
config.tomlwhenever it gets staged for a commit. So that its changes containing thoseenv()will never get pushed...Beta Was this translation helpful? Give feedback.
All reactions