Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use exit code 21 in GitHub action if working-directory is missing #594

Open
akaihola opened this issue Jul 28, 2024 · 0 comments
Open

Use exit code 21 in GitHub action if working-directory is missing #594

akaihola opened this issue Jul 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@akaihola
Copy link
Owner

For error handling, it would be useful to have a unique exit code from the Darker GitHub action if the directory specified as working-directory doesn't exist.

Here's the current behavior:

Traceback (most recent call last):
  File "/home/runner/work/darker/darker/action/main.py", line 59, in <module>
    proc = run(  # nosec
  File "/usr/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/_temp/non-existent-dir'
##[error]Process completed with exit code 1.

Darker itself uses an exit code of 2 if a file doesn't exist. For example 21 as a variation of that code could be used for the action.

@akaihola akaihola added the enhancement New feature or request label Jul 28, 2024
@akaihola akaihola added this to the Darker 2.1.2 milestone Jul 28, 2024
@akaihola akaihola self-assigned this Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant