Skip to content

Commit

Permalink
Fixesg
Browse files Browse the repository at this point in the history
  • Loading branch information
manquer committed Sep 16, 2024
1 parent baaf3e6 commit c7d6019
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
5 changes: 0 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
7 changes: 3 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/env.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const items = filter(keys(secrets), i => !startsWith(i, 'AZURE'))
export async function setup(prefix: string): Promise<void> {
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<string> => {
const value: string = await Kv.getSecret(prefix, key)
return `\n${key}=${value}`
Expand Down
3 changes: 1 addition & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export async function run(): Promise<void> {
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)
Expand Down

0 comments on commit c7d6019

Please sign in to comment.