From e1e41bfa9da0aa3e689c0967e8f20524231daa29 Mon Sep 17 00:00:00 2001 From: Mani Ka Date: Mon, 16 Sep 2024 00:22:28 -0700 Subject: [PATCH] bundle cleanup --- dist/index.js | 8 +------- src/env.ts | 5 ----- src/kv.ts | 3 +-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index e2665ec..c5cb93b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -82105,14 +82105,13 @@ class KeyVaultClient { let value = (0,lodash.get)(this.#keys, key); // in memory cache if (!value) { const k = key.replace(/_/g, '-'); + core.info(`fetching... ${k}`); const secret = await this.#client.getSecret(`${prefix}-${k}`); value = (0,lodash.get)(secret, 'value'); - core.info(value); if (!value) throw new Error(`Secret ${k} not found in service ${prefix}`); this.#keys = (0,lodash.set)(this.#keys, key, value); } - core.info(value); return value; } } @@ -82122,20 +82121,15 @@ class KeyVaultClient { - async function setup(prefix) { const items = (0,lodash.filter)(Object.keys(process.env), (i) => (0,lodash.startsWith)(i, `${prefix}_`)); const res = await PromiseExtended.map(items, async (k) => { const key = k.split(`${prefix}_`)[1]; - console.log(key); const value = await kv.getSecret(prefix, key); - console.log(value); return `\n${key}=${value}`; }); - core.info(res.toString()); const env = (0,lodash.reduce)(res, (acc, i) => `${acc}${i}`); const current = process.env.GITHUB_ENV; - core.info(env); process.env.GITHUB_ENV = `${current}${env}`; } diff --git a/src/env.ts b/src/env.ts index cc845fd..7d7f62a 100644 --- a/src/env.ts +++ b/src/env.ts @@ -1,19 +1,14 @@ import { reduce, filter, startsWith } from 'lodash' -import * as core from '@actions/core' import { PromiseExtended } from './promise' import Kv from './kv' export async function setup(prefix: string): Promise { const items = filter(Object.keys(process.env), (i: string) => startsWith(i, `${prefix}_`)) const res = await PromiseExtended.map(items, async (k: string): Promise => { const key = k.split(`${prefix}_`)[1] - console.log(key) const value: string = await Kv.getSecret(prefix, key) - console.log(value) return `\n${key}=${value}` }) - core.info(res.toString()) const env = reduce(res, (acc, i) => `${acc}${i}`) const current = process.env.GITHUB_ENV - core.info(env) process.env.GITHUB_ENV = `${current}${env}` } diff --git a/src/kv.ts b/src/kv.ts index a7c9b3c..4529c74 100644 --- a/src/kv.ts +++ b/src/kv.ts @@ -22,13 +22,12 @@ export class KeyVaultClient { let value = get(this.#keys, key) // in memory cache if (!value) { const k = key.replace(/_/g, '-') + core.info(`fetching... ${k}`) const secret: KeyVaultSecret = await this.#client.getSecret(`${prefix}-${k}`) value = get(secret, 'value') - core.info(value) if (!value) throw new Error(`Secret ${k} not found in service ${prefix}`) this.#keys = set(this.#keys, key, value) } - core.info(value) return value } }