From c6a604a6465b0236745bc7f297163df74b536144 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 19 Sep 2024 15:36:59 +0200 Subject: [PATCH] chore: use env variables --- plugins/kontinuous-ui/.gitignore | 1 + .../kontinuous-ui/pre-deploy/01-deployment_event.js | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 plugins/kontinuous-ui/.gitignore diff --git a/plugins/kontinuous-ui/.gitignore b/plugins/kontinuous-ui/.gitignore new file mode 100644 index 000000000..4c49bd78f --- /dev/null +++ b/plugins/kontinuous-ui/.gitignore @@ -0,0 +1 @@ +.env diff --git a/plugins/kontinuous-ui/pre-deploy/01-deployment_event.js b/plugins/kontinuous-ui/pre-deploy/01-deployment_event.js index 8eb59ad68..d90510898 100644 --- a/plugins/kontinuous-ui/pre-deploy/01-deployment_event.js +++ b/plugins/kontinuous-ui/pre-deploy/01-deployment_event.js @@ -1,19 +1,19 @@ const { createClient } = require("@supabase/supabase-js") -module.exports = async (_manifests, _options, { config }) => { +module.exports = async (_manifests, _options, { config, ctx }) => { + const processEnv = ctx.get("env") || process.env + const { SUPABASE_URL: supabaseUrl, SUPABASE_KEY: supabaseKey } = processEnv + console.log("ENV", processEnv, supabaseUrl, supabaseKey) const { - actionCommandName, gitSha, projectName, environment, refLabelValue, repositoryName, + actionCommandName, } = config - const supabase = createClient( - "https://dabwsunwcukreynmegja.supabase.co", - "XXXX" - ) + const supabase = createClient(supabaseUrl, supabaseKey) const { error } = await supabase.from("deployments_logs").insert([ {