Skip to content

Commit 02d98c9

Browse files
authored
support workdir field (#6)
* consume workdir * and dist * always npm install to match
1 parent ede2aad commit 02d98c9

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/index.js: src/index.js
2+
npm install
23
node_modules/.bin/ncc build $^ --target es2020

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ inputs:
1717
description: The git ref to build. This will usually be a sha, but can be a branch or anything supported by git checkout.
1818
token:
1919
description: Pass `github.token` if this is a private repository.
20+
workdir:
21+
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.
2022

2123
runs:
2224
using: node20

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26971,6 +26971,9 @@ function parseBuildId(stdout) {
2697126971
if (getInput('token')) {
2697226972
startArgs.push('--token', getInput('token'));
2697326973
}
26974+
if (getInput('workdir')) {
26975+
startArgs.push('--workdir', getInput('workdir'));
26976+
}
2697426977
const spawnRet = spawnSync(cliPath, startArgs);
2697526978
checkSpawnSync(spawnRet);
2697626979
const buildId = parseBuildId(spawnRet.stdout);

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ function parseBuildId(stdout) {
125125
if (getInput('token')) {
126126
startArgs.push('--token', getInput('token'));
127127
}
128+
if (getInput('workdir')) {
129+
startArgs.push('--workdir', getInput('workdir'));
130+
}
128131
const spawnRet = spawnSync(cliPath, startArgs);
129132
checkSpawnSync(spawnRet);
130133
const buildId = parseBuildId(spawnRet.stdout);

0 commit comments

Comments
 (0)