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

Brakeman: return a zero status code if any warnings are found #1559

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

brucebolt
Copy link
Member

@brucebolt brucebolt commented Jan 2, 2025

Brakeman returns a non-zero status code when there are warnings found or errors during the scan.

In 9fc187b, we allowed the GitHub Action to continue on error, so that the warning/error would be uploaded to GitHub code scanning.

However the non-zero status code still gets written to the GitHub Action output. This led to confusion in
alphagov/asset-manager#1583 as we thought the error meant brakeman did not complete properly, when in fact it did but was only returning that code because a code scanning warning had been found.

Therefore updating the brakeman configuration to report a zero status code when a warning or error is found. This means we can remove the previous change, as any completed run will not return a non-zero status code. This will also stop the non-zero code causing confusion in the GitHub Actions output.

Trello card

Brakeman returns a non-zero status code when there are warnings found or
errors during the scan.

In 9fc187b, we allowed the GitHub
Action to continue on error, so that the warning/error would be uploaded
to GitHub code scanning.

However the non-zero status code still gets written to the GitHub Action
output. This led to confusion in
alphagov/asset-manager#1583 as we thought the
error meant brakeman did not complete properly, when in fact it did but
was only returning that code because a code scanning warning had been
found.

Therefore updating the brakeman configuration to report a zero status
code when a warning or error is found. This means we can remove the
previous change, as any completed run will not return a non-zero status
code. This will also stop the non-zero code causing confusion in the
GitHub Actions output.
@brucebolt brucebolt marked this pull request as ready for review January 2, 2025 15:23
@brucebolt brucebolt requested a review from AgaDufrat January 2, 2025 15:54
@brucebolt brucebolt merged commit b46c4bc into main Jan 3, 2025
1 check passed
@brucebolt brucebolt deleted the update-brakeman branch January 3, 2025 12:15
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