Skip to content

Commit

Permalink
Update main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sscotth authored Jun 21, 2023
1 parent abaf34d commit 1472382
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export default async function run(): Promise<void> {
const convertPrefix = convertPrefixStr.length
? convertPrefixStr === 'true'
: true
const overrideStr: string = core.getInput('override')
const override: string = overrideStr.length
? overrideStr === 'true'
: true

let secrets: Record<string, string>
try {
Expand Down Expand Up @@ -88,7 +92,14 @@ with:
}
}

if (process.env[newKey]) {
let priorEnvExists = process.env[newKey]

if (priorEnvExists && !override) {
core.info(`Skip overwriting secret ${newKey}`)
continue
}

if (priorEnvExists && override) {
core.warning(`Will re-write "${newKey}" environment variable.`)
}

Expand Down

0 comments on commit 1472382

Please sign in to comment.