Skip to content

Passing an invalid path into @actions.exec.exec options argument throws confusing errror #573

@cdb

Description

@cdb

Describe the bug

Calling exec.exec(some_command, some_args, {cwd: <bad-path>} ends up throwing an error that says #[error]There was an error when attempting to execute the process '/bin/<some_command>'. This may indicate the process failed to start. Error: spawn /bin/<some-command> ENOENT. I assume the ENOENT is because of the missing directory, but it seems like it's the binary command that's actually missing.

To Reproduce
Steps to reproduce the behavior:

  1. Add await exec.exec("ls", "-Fla", { cwd: "/bad/path" }); to an action that's using @actions/exec
  2. Run the action, and see ::error::There was an error when attempting to execute the process '/bin/ls'. This may indicate the process failed to start. Error: spawn /bin/ls ENOENT in the log output

Expected behavior

An error message along the lines of Setting working directory to "/bad/path" which does not exist would be more user friendly

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions