Repository navigation
fix: handle empty scanner results and add fail-on-error input - #12
Merged
Merged
Conversation
Relates to #10 ## What Move control line parsing before markdown output so the step detects empty results early and displays a re-run message instead of failing. Add a fail-on-error input (default false) that exits 1 when the assessment has failed controls, giving users opt-in strict mode. ## Why The scanner occasionally completes without emitting control results. The previous grep piped directly into a while loop under set -e, causing the step to fail with exit code 1 on zero matches. The new fail-on-error flag lets users who want to gate merges on assessment results opt in without breaking existing workflows. ## Notes - The || true on grep is critical — without it, any run where the scanner silently fails will also fail this step - fail-on-error defaults to false for backward compatibility; existing users see no behavior change - The FAILED count is parsed from the summary line in the parent shell scope, not inside the piped while-loop subshell, so it's accessible for the exit check Signed-off-by: jmeridth <jmeridth@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #10
What
Move control line parsing before markdown output so the step detects empty results early and displays a re-run message instead of failing. Add a fail-on-error input (default false) that exits 1 when the assessment has failed controls, giving users opt-in strict mode.
Why
The scanner occasionally completes without emitting control results. The previous grep piped directly into a while loop under set -e, causing the step to fail with exit code 1 on zero matches. The new fail-on-error flag lets users who want to gate merges on assessment results opt in without breaking existing workflows.
Notes
actions/github-scriptto utilizecore.summarywhich has a builder API for markdown tables