Code cleanup

This commit is contained in:
Jill Regan
2026-02-19 14:17:40 -05:00
parent 24235f3b6b
commit 015b03300e
2 changed files with 18 additions and 13 deletions

View File

@@ -30,7 +30,7 @@ export const validateAuth = (): void => {
core.info(`Authenticated with ${authType}.`);
};
export const getEnvVarNamesWithSecretRefs = (): string[] =>
const getEnvVarNamesWithSecretRefs = (): string[] =>
Object.keys(process.env).filter(
(key) =>
typeof process.env[key] === "string" &&
@@ -58,8 +58,6 @@ export const extractSecret = (
envName: string,
shouldExportEnv: boolean,
): void => {
core.info(`Populating variable: ${envName}`);
const ref = process.env[envName];
if (!ref) {
return;
@@ -70,16 +68,8 @@ export const extractSecret = (
return;
}
if (shouldExportEnv) {
core.exportVariable(envName, secretValue);
} else {
core.setOutput(envName, secretValue);
}
// Skip setSecret for empty strings to avoid the warning:
// "Can't add secret mask for empty string in ##[add-mask] command."
if (secretValue) {
core.setSecret(secretValue);
}
setResolvedSecret(envName, secretValue, shouldExportEnv);
};
// Connect loads secrets via the 1Password CLI