You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I would expect that exec.exec('someCommandThatDoesNotExists', [], {ignoreReturnCode:true, failOnStdErr:false}) would simply return a Promise that resolves to 127.
Instead it appears that it throws an exception: which ultimately comes from the fact that it is using io.which with a check flag equal to true over at https://github.com/actions/toolkit/blob/main/packages/exec/src/toolrunner.ts#L411
To Reproduce
Steps to reproduce the behavior:
From a custom javascript based github action perform
const exitCode = await exec.exec('someCommandThatDoesNotExists', [], {ignoreReturnCode:true, failOnStdErr:false})
and a execute the action
Expected behavior
You'll find that instead of getting the exitCode to process yourself, an exception is thrown. This is not at all what is expected from users like myself when I explicitly requested to process the return code myself with
ignoreReturnCode:true, failOnStdErr:false
A Promise that resolves to 127 should be returned.
Desktop (please complete the following information):
all platforms
The text was updated successfully, but these errors were encountered:
stephen-carter-at-sf
changed the title
exec should not fail if io.which fails when using {ignoreReturnCode: true, failOnStdErr:false}
exec should not fail if provided a command with a missing tool when using {ignoreReturnCode: true, failOnStdErr:false}
Jan 12, 2024
Describe the bug
I would expect that exec.exec('someCommandThatDoesNotExists', [], {ignoreReturnCode:true, failOnStdErr:false}) would simply return a Promise that resolves to 127.
Instead it appears that it throws an exception: which ultimately comes from the fact that it is using io.which with a check flag equal to true over at https://github.com/actions/toolkit/blob/main/packages/exec/src/toolrunner.ts#L411
To Reproduce
Steps to reproduce the behavior:
From a custom javascript based github action perform
const exitCode = await exec.exec('someCommandThatDoesNotExists', [], {ignoreReturnCode:true, failOnStdErr:false})
and a execute the action
Expected behavior
You'll find that instead of getting the exitCode to process yourself, an exception is thrown. This is not at all what is expected from users like myself when I explicitly requested to process the return code myself with
ignoreReturnCode:true, failOnStdErr:false
A Promise that resolves to 127 should be returned.
Desktop (please complete the following information):
all platforms
The text was updated successfully, but these errors were encountered: