From c7d6019552d7f47121470d04c9384fa03aaedcbb Mon Sep 17 00:00:00 2001 From: Mani Ka Date: Sun, 15 Sep 2024 21:28:15 -0700 Subject: [PATCH] Fixesg --- action.yml | 5 ----- dist/index.js | 7 +++---- src/env.ts | 4 ++-- src/main.ts | 3 +-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/action.yml b/action.yml index ada59e3..01bdb14 100644 --- a/action.yml +++ b/action.yml @@ -11,11 +11,6 @@ inputs: description: 'service prefix to get keys from' required: true default: 'SVC' - SECRETS_CONTEXT: - description: 'keys' - required: false - default: ${{ toJSON(secrets) }} runs: using: 'node20' main: dist/index.js - env: diff --git a/dist/index.js b/dist/index.js index f5e7206..17e517a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -82114,8 +82114,8 @@ class KeyVaultClient { -async function setup(prefix, secrets) { - const items = (0,lodash.filter)((0,lodash.keys)(secrets), i => !(0,lodash.startsWith)(i, 'AZURE')); +async function setup(prefix) { + const items = (0,lodash.filter)((0,lodash.keys)(process.env), (i) => (0,lodash.startsWith)(i, 'INPUT_ENVKEY_') && !(0,lodash.startsWith)(i, 'INPUT_ENVKEY_AZURE_')); const res = await PromiseExtended.map(items, async (key) => { const value = await kv.getSecret(prefix, key); return `\n${key}=${value}`; @@ -82136,8 +82136,7 @@ async function run() { try { // const version = process.env.VERSION as Version const SVC_PREFIX = core.getInput('SERVICE_PREFIX'); - const SECRETS = core.getInput('SECRETS_CONTEXT'); - await setup(SVC_PREFIX, SECRETS); + await setup(SVC_PREFIX); } catch (error) { // Fail the workflow run if an error occurs diff --git a/src/env.ts b/src/env.ts index 40a0352..c3c472e 100644 --- a/src/env.ts +++ b/src/env.ts @@ -1,8 +1,8 @@ import { keys, reduce, filter, startsWith } from 'lodash' import { PromiseExtended } from './promise' import Kv from './kv' -export async function setup(prefix: string, secrets: any): Promise { - const items = filter(keys(secrets), i => !startsWith(i, 'AZURE')) +export async function setup(prefix: string): Promise { + const items = filter(keys(process.env), (i: string) => startsWith(i, 'INPUT_ENVKEY_') && !startsWith(i, 'INPUT_ENVKEY_AZURE_')) const res = await PromiseExtended.map(items, async (key: string): Promise => { const value: string = await Kv.getSecret(prefix, key) return `\n${key}=${value}` diff --git a/src/main.ts b/src/main.ts index 94dcb64..75756db 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,8 +10,7 @@ export async function run(): Promise { try { // const version = process.env.VERSION as Version const SVC_PREFIX: string = core.getInput('SERVICE_PREFIX') - const SECRETS: any = core.getInput('SECRETS_CONTEXT') - await setup(SVC_PREFIX, SECRETS) + await setup(SVC_PREFIX) } catch (error) { // Fail the workflow run if an error occurs if (error instanceof Error) core.setFailed(error.message)