Skip to content

Allow non-0 exit codes#10

Draft
ullebe1 wants to merge 1 commit into
mbogh:mainfrom
ullebe1:main
Draft

Allow non-0 exit codes#10
ullebe1 wants to merge 1 commit into
mbogh:mainfrom
ullebe1:main

Conversation

@ullebe1

@ullebe1 ullebe1 commented Jun 5, 2024

Copy link
Copy Markdown

This PR adds an execOptions object that is passed to core.exec() to allow non-zero exit codes. This is because testssl.sh now uses the exit code to signal ambigous results or errors, which can be present during a successful test. This is documented here.

@mbogh

mbogh commented Jun 6, 2024

Copy link
Copy Markdown
Owner

I feel like it is something we should let the users of the action configure the behaviour, also to not break things for existing users.

Furthermore it should still fail with exit codes 242 to 255 as these are "real" errors.

@ullebe1

ullebe1 commented Jun 6, 2024

Copy link
Copy Markdown
Author

I feel like it is something we should let the users of the action configure the behaviour, also to not break things for existing users.

I can add a threshold like the one for the score? That way one can have a configurable amount of ambiguous results and errors. The default could then be set to allow only scores of 0, to replicate current behaviour.

Furthermore it should still fail with exit codes 242 to 255 as these are "real" errors.

Absolutely.

I've been experimenting with also printing the the exit code in the output, but it seems that both console.log() and core.info() don't print anything. Do you know what the right way to print to the output of a GitHub action is?

@mbogh

mbogh commented Jun 6, 2024

Copy link
Copy Markdown
Owner

I've been experimenting with also printing the the exit code in the output, but it seems that both console.log() and core.info() don't print anything. Do you know what the right way to print to the output of a GitHub action is?

Given the docs it should be the way to go, try using the core.warning as it would also provide an annotation, which is more visible.

I can add a threshold like the one for the score? That way one can have a configurable amount of ambiguous results and errors. The default could then be set to allow only scores of 0, to replicate current behaviour.
So something like errorAndAmbiguousResultCount where the default is 0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants