Skip to content

Commit

Permalink
chore: build separate env
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Sep 4, 2024
1 parent 3f8c1da commit 1368fe1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/workflow-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { PluginContext } from "./utils/plugin-context-single";
import { proxyWorkflowCallbacks } from "./handlers/callbacks-proxy";
import { bubbleUpErrorComment, sanitizeMetadata } from "./utils/errors";
import dotenv from "dotenv";
import { LOG_LEVEL } from "@ubiquity-dao/ubiquibot-logger";
dotenv.config();


Expand All @@ -14,9 +15,27 @@ dotenv.config();
*/
export async function run() {
const payload = github.context.payload.inputs;

let env, settings;

const payloadEnv = {
BOT_TOKEN: process.env.BOT_TOKEN,
BOT_MODE: process.env.BOT_MODE,
LOG_LEVEL: process.env.LOG_LEVEL,
DEBUG: process.env.DEBUG,
BOT_WEBHOOK: process.env.BOT_WEBHOOK,
BOT_WEBHOOK_SECRET: process.env.BOT_WEBHOOK_SECRET,
BOT_ADMINS: process.env.BOT_ADMINS,
TELEGRAM_APP_ID: process.env.TELEGRAM_APP_ID,
TELEGRAM_API_HASH: process.env.TELEGRAM_API_HASH,
SUPABASE_URL: process.env.SUPABASE_URL,
SUPABASE_KEY: process.env.SUPABASE_KEY,
APP_PRIVATE_KEY: process.env.APP_PRIVATE_KEY,
APP_ID: process.env.APP_ID,
}

try {
env = Value.Decode(envValidator.schema, process.env);
env = Value.Decode(envValidator.schema, payloadEnv);
} catch (err) {
console.log("Error decoding env: ", err);
}
Expand Down

0 comments on commit 1368fe1

Please sign in to comment.