refactor(actions): simplify action path structure
- Relocates action files to a flat directory structure - Updates references to the new paths for better organization
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
name: "with-post-step"
|
||||
description: "Runs a main command and, afterwards, a post command."
|
||||
inputs:
|
||||
main: { description: "Command for the main step", required: true }
|
||||
post: { description: "Command for the post step", required: true }
|
||||
key: { description: "State key", default: POST }
|
||||
|
||||
runs:
|
||||
using: node20
|
||||
main: main.js
|
||||
post: main.js
|
@@ -1,18 +0,0 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user