Skip to content

Commit

Permalink
chore: extract vars from process.env
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Sep 29, 2024
1 parent e92b3de commit c29c8b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import * as github from "@actions/github";
import * as core from "@actions/core";
import { Value } from "@sinclair/typebox/value";
import { envSchema } from "./types/env";
import { Env, envSchema } from "./types/env";
import { assistivePricingSettingsSchema, PluginInputs } from "./types/plugin-input";
import { run } from "./run";

/**
* Run the plugin as a GitHub Action instance.
*/
async function actionRun() {
const env = Value.Decode(envSchema, process.env);
const payloadEnv = {
SUPABASE_KEY: process.env.SUPABASE_KEY,
SUPABASE_URL: process.env.SUPABASE_URL,
UBIQUIBOT_PUBLIC_KEY: process.env.UBIQUIBOT_PUBLIC_KEY,
};

const env = Value.Decode(envSchema, payloadEnv);

const webhookPayload = github.context.payload.inputs;
const settings = Value.Decode(assistivePricingSettingsSchema, Value.Default(assistivePricingSettingsSchema, JSON.parse(webhookPayload.settings)));
Expand Down

0 comments on commit c29c8b0

Please sign in to comment.