From a59d89e39375f91c24f1d3a9f4541658b284b72b Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 3 Jun 2026 05:00:53 -0400 Subject: [PATCH] Claude output json processing --- .../workflows/claude-full-security-scan.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/claude-full-security-scan.yml b/.github/workflows/claude-full-security-scan.yml index 1ebdbbed..afae2b74 100644 --- a/.github/workflows/claude-full-security-scan.yml +++ b/.github/workflows/claude-full-security-scan.yml @@ -103,4 +103,26 @@ jobs: name: claude-full-codebase-security-scan-${{ github.run_id }} path: ${{ steps.claude_scan.outputs.execution_file }} if-no-files-found: warn + retention-days: 30 + + - name: Extract JSON findings from Claude output + if: always() && steps.claude_scan.outputs.execution_file != '' + shell: bash + run: | + jq -r ' + .[] + | select(.type == "result") + | .result + | sub("^[^{]*"; "") + ' "${{ steps.claude_scan.outputs.execution_file }}" | jq . > security-findings.json + + jq -e '.findings and .analysis_summary' security-findings.json > /dev/null + + - name: Upload extracted JSON findings + if: always() && hashFiles('security-findings.json') != '' + uses: actions/upload-artifact@v4 + with: + name: security-findings-${{ github.run_id }} + path: security-findings.json + if-no-files-found: error retention-days: 30 \ No newline at end of file