Skip to content

Commit

Permalink
support workdir field (#6)
Browse files Browse the repository at this point in the history
* consume workdir

* and dist

* always npm install to match
  • Loading branch information
abe-winter authored Oct 10, 2024
1 parent ede2aad commit 02d98c9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/index.js: src/index.js
npm install
node_modules/.bin/ncc build $^ --target es2020
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26971,6 +26971,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);
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 02d98c9

Please sign in to comment.