+1
-1
@@ -5,3 +5,3 @@ { | ||
| "type": "module", | ||
| "version": "0.0.19", | ||
| "version": "0.0.20", | ||
| "files": [ | ||
@@ -8,0 +8,0 @@ "src", |
@@ -9,2 +9,4 @@ import { createCommand } from "commander"; | ||
| from: string; | ||
| overwrite?: boolean; | ||
| exclude?: string[]; | ||
| }; | ||
@@ -24,2 +26,4 @@ | ||
| ) | ||
| .option("-o, --overwrite", "Overwrite existing secrets") | ||
| .option("-e, --exclude <secrets...>", "Secrets to exclude from the copy") | ||
| .action(async () => { | ||
@@ -37,17 +41,21 @@ const options = command.opts<Options>(); | ||
| await Promise.all( | ||
| parameters.secrets.map(async ({ name, value }) => { | ||
| console.log( | ||
| `Copying secret ${name} from ${options.from} to ${options.to}`, | ||
| ); | ||
| const result = await Promise.allSettled( | ||
| parameters.secrets | ||
| .filter(({ name }) => !options.exclude?.includes(name)) | ||
| .map(async ({ name, value }) => { | ||
| console.log( | ||
| `Copying secret ${name} from ${options.from} to ${options.to}`, | ||
| ); | ||
| await putSecret( | ||
| { | ||
| ...prefixOptions, | ||
| overwrite: true, | ||
| }, | ||
| name, | ||
| value, | ||
| ); | ||
| }), | ||
| await putSecret( | ||
| { | ||
| ...prefixOptions, | ||
| overwrite: options.overwrite, | ||
| }, | ||
| name, | ||
| value, | ||
| ); | ||
| return name; | ||
| }), | ||
| ); | ||
@@ -57,2 +65,12 @@ | ||
| const successful = result | ||
| .map((res) => (res.status === "fulfilled" ? res.value : undefined)) | ||
| .filter(Boolean); | ||
| parameters.secrets | ||
| .filter(({ name }) => !successful.includes(name)) | ||
| .forEach(({ name }) => { | ||
| console.warn(`Failed to copy secret ${name}`); | ||
| }); | ||
| if (parameters.invalidParameters?.length) { | ||
@@ -59,0 +77,0 @@ console.warn("Some secrets could not be found:"); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
13062
5.16%393
3.97%