From 67a1f9dc079313352b18956b2cf1ccecd53f6eae Mon Sep 17 00:00:00 2001 From: Abe Winter Date: Thu, 10 Oct 2024 16:20:29 -0400 Subject: [PATCH] consume workdir --- action.yml | 2 ++ src/index.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/action.yml b/action.yml index a360271..baecc03 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,8 @@ inputs: description: The git ref to build. This will usually be a sha, but can be a branch or anything supported by git checkout. token: description: Pass `github.token` if this is a private repository. + workdir: + description: Use this if your module is not in the repo root. If you pass this, the `meta-path` will be relative to this workdir, not to repo root. runs: using: node20 diff --git a/src/index.js b/src/index.js index d099833..a3d22fe 100644 --- a/src/index.js +++ b/src/index.js @@ -125,6 +125,9 @@ function parseBuildId(stdout) { if (getInput('token')) { startArgs.push('--token', getInput('token')); } + if (getInput('workdir')) { + startArgs.push('--workdir', getInput('workdir')); + } const spawnRet = spawnSync(cliPath, startArgs); checkSpawnSync(spawnRet); const buildId = parseBuildId(spawnRet.stdout);