mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-26 02:11:04 -05:00
15 lines
431 B
TypeScript
15 lines
431 B
TypeScript
import process from "process";
|
|
|
|
export function setupInput(input: Record<string, any>): void {
|
|
for (const [key, value] of Object.entries(input)) {
|
|
process.env[`INPUT_${key.replace(/ /g, "_").toUpperCase()}`] = value.toString();
|
|
}
|
|
}
|
|
|
|
export function unsetInput(): void {
|
|
for (const key of Object.keys(process.env)) {
|
|
if (key.startsWith("INPUT_")) {
|
|
delete process.env[key];
|
|
}
|
|
}
|
|
}
|