toolrunner should which tool before invoking (#220)

This commit is contained in:
eric sciple
2019-11-18 16:20:01 -05:00
committed by GitHub
parent 9a3c005162
commit 5c894298f2
10 changed files with 261 additions and 65 deletions

View File

@@ -48,13 +48,10 @@ await exec.exec('node', ['index.js', 'foo=bar'], options);
#### Exec tools not in the PATH
You can use it in conjunction with the `which` function from `@actions/io` to execute tools that are not in the PATH:
You can specify the full path for tools not in the PATH:
```js
const exec = require('@actions/exec');
const io = require('@actions/io');
const pythonPath: string = await io.which('python', true)
await exec.exec(`"${pythonPath}"`, ['main.py']);
await exec.exec('"/path/to/my-tool"', ['arg1']);
```