From 7892a1fa7c2451ea947c11f0cf71ba189306d708 Mon Sep 17 00:00:00 2001 From: "Max P." Date: Fri, 4 Jul 2025 11:59:29 +0200 Subject: [PATCH] feat(exec): add support for custom working directories - Updates script execution to use `cwd` based on environment variables - Enables better compatibility with GitHub Actions workflows --- dist/main.js | 6 +++++- dist/post.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/main.js b/dist/main.js index e8f85fe..359d908 100644 --- a/dist/main.js +++ b/dist/main.js @@ -3,7 +3,11 @@ const path = require("path"); const fs = require("fs"); function run(script) { - cp.execFileSync(script, { stdio: "inherit", shell: true }); + cp.execFileSync(script, { + stdio: "inherit", + shell: true, + cwd: process.env.GITHUB_WORKSPACE || process.cwd() + }); } function exportOutput(key, value) { diff --git a/dist/post.js b/dist/post.js index 336a652..778339e 100644 --- a/dist/post.js +++ b/dist/post.js @@ -7,6 +7,7 @@ function run(script, args = []) { stdio: "inherit", shell: true, env: process.env, + cwd: process.env.GITHUB_WORKSPACE || process.cwd(), }); }