Files
auto-changelog-release-action/with-post-step/main.js
Max P. 30f83b08ee refactor(actions): simplify action path structure
- Relocates action files to a flat directory structure
- Updates references to the new paths for better organization
2025-07-04 11:35:16 +02:00

19 lines
555 B
JavaScript

const { spawn } = require("child_process");
const { appendFileSync } = require("fs");
const { EOL } = require("os");
function run(cmd) {
const proc = spawn(cmd, { stdio: "inherit", shell: true });
proc.on("exit", code => process.exitCode = code);
}
const key = process.env.INPUT_KEY.toUpperCase();
if (process.env[`STATE_${key}`] !== undefined) {
// ---------- POST ----------
run(process.env.INPUT_POST);
} else {
// ---------- MAIN ----------
appendFileSync(process.env.GITHUB_STATE, `${key}=true${EOL}`);
run(process.env.INPUT_MAIN);
}