Conversation
…sing (anthropics#129) - Verify jq is present or successfully installed in 'Install dependencies', failing loudly if unavailable - In 'Run ClaudeCode scan', verify jq is available in PATH before attempting to parse - Validate claudecode-results.json is valid JSON before parsing findings - Remove silent fallback to findings_count=0 on jq execution failure, failing with an explicit error instead Fixes anthropics#129
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.
Description
Resolves #129.
Currently in
action.yml:sudo apt-get update && sudo apt-get install -y jqwithout checking if it succeeded.Run ClaudeCode scan,jq -e '.error'andCLAUDECODE_FINDINGS_COUNT=$(jq -r ... 2>/dev/null || echo "0")swallowjqfailures (such as missingjqor malformed JSON), silently defaultingfindings_count=0. This causes scans with real findings to be reported as clean passes whenjqis broken or unavailable.Proposed Changes
jqis already present before runningapt-get(avoiding redundant package updates on runners wherejqis pre-installed). If missing, attempt to install it and verifycommand -v jq, failing loudly with::error::if it cannot be found.jqis available inPATH.jq empty claudecode/claudecode-results.jsonto verify the output file is well-formed JSON before accessing fields, surfacingclaudecode-error.logand exiting non-zero if invalid.|| echo "0"/|| echo '[]'fallbacks that mask execution errors, failing explicitly if result parsing fails.