Skip to content

Commit

Permalink
Fail on err
Browse files Browse the repository at this point in the history
  • Loading branch information
manquer committed Sep 20, 2024
1 parent 96fe700 commit acf2caa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import Kv from './kv'
export async function setup(prefix: string): Promise<void> {
const items = filter(Object.keys(process.env), (i: string) => startsWith(i, `${prefix}_`) || startsWith(i, `KV_`))
await PromiseExtended.map(items, async (k: string): Promise<void> => {
const key = get(k.split(`${prefix}_`), '1') || get(k.split(`KV_`), '1')
const value: string = await Kv.getSecret(prefix, key)
core.exportVariable(key, value)
core.setSecret(`${value}`)
try {
const key = get(k.split(`${prefix}_`), '1') || get(k.split(`KV_`), '1')
const value: string = await Kv.getSecret(prefix, key)
core.exportVariable(key, value)
core.setSecret(`${value}`)
} catch (err) {
core.setFailed(`err: ${err}`)
}
})
}

0 comments on commit acf2caa

Please sign in to comment.