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

Exit codes #483

Closed
cemoktra opened this issue Nov 18, 2022 · 1 comment · Fixed by #538
Closed

Exit codes #483

cemoktra opened this issue Nov 18, 2022 · 1 comment · Fixed by #538
Assignees
Labels
enhancement New feature or request

Comments

@cemoktra
Copy link

Is your feature request related to a problem? Please describe.
In CI i would like to react differently on advisories and the other categories. Cause advisories are caused by external parties and a solution might not be available immediately, so this should not stop the pipeline but cause a warning.

Describe the solution you'd like
Flag based exit codes could help here. e.g.

  • advisories 0x0001
  • bans 0x0010
  • licenses 0x0100
  • sources 0x1000

When combined with OR i could decompose if one category has occured using AND.

Describe alternatives you've considered
The alternative currently is running deny twice with different categories, while allowing one to fail. But t should be possible to handle this with one run.

@cemoktra cemoktra added the enhancement New feature or request label Nov 18, 2022
@ahollmann
Copy link

ahollmann commented Nov 18, 2022

Exit codes are restricted. You have a range of 0 to 255.

If the number of checks does not grow to much it would work.

EXIT STATUS         [top](https://man7.org/linux/man-pages/man1/exit.1p.html#top_of_page)
       The exit status shall be n, if specified, except that the
       behavior is unspecified if n is not an unsigned decimal integer
       or is greater than 255. Otherwise, the value shall be the exit
       value of the last command executed, or zero if no command was
       executed. When exit is executed in a trap action, the last
       command is considered to be the command that executed immediately
       preceding the trap action.

@Jake-Shadle Jake-Shadle self-assigned this Jul 29, 2023
Jake-Shadle added a commit that referenced this issue Jul 29, 2023
- Use bitset for exit code
- Note exit codes in the book

Resolves: #483
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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants