|
24 | 24 | git clone https://github.com/${{ github.repository }} . |
25 | 25 | git checkout ${{ github.ref_name }} |
26 | 26 |
|
27 | | - - name: Install TruffleHog and SARIF tools |
| 27 | + - name: Install TruffleHog |
28 | 28 | run: | |
29 | 29 | pip install trufflehog |
30 | 30 |
|
|
37 | 37 | run: | |
38 | 38 | echo "import json" > convert_to_sarif.py |
39 | 39 | echo "" >> convert_to_sarif.py |
40 | | - echo "with open('trufflehog-findings.json') as f:" >> convert_to_sarif.py |
41 | | - echo " findings = json.load(f)" >> convert_to_sarif.py |
| 40 | + echo "try:" >> convert_to_sarif.py |
| 41 | + echo " with open('trufflehog-findings.json') as f:" >> convert_to_sarif.py |
| 42 | + echo " findings = json.load(f)" >> convert_to_sarif.py |
| 43 | + echo "except Exception as e:" >> convert_to_sarif.py |
| 44 | + echo " print('Failed to parse findings:', e)" >> convert_to_sarif.py |
| 45 | + echo " findings = []" >> convert_to_sarif.py |
42 | 46 | echo "" >> convert_to_sarif.py |
43 | 47 | echo "sarif = {" >> convert_to_sarif.py |
44 | 48 | echo " 'version': '2.1.0'," >> convert_to_sarif.py |
|
94 | 98 | -H "Content-Type: application/json" \ |
95 | 99 | https://api.github.com/repos/${{ github.repository }}/code-scanning/sarifs \ |
96 | 100 | -d "{\"commit_sha\": \"${{ github.sha }}\",\"ref\": \"${{ github.ref }}\",\"sarif\": \"$encoded_sarif\",\"checkout_uri\": \"https://github.com/${{ github.repository }}\",\"tool_name\": \"TruffleHog\"}" |
97 | | -
|
98 | | - -H "Content-Type: application/json" \ |
99 | | - https://api.github.com/repos/${{ github.repository }}/code-scanning/sarifs \ |
100 | | - -d "{\n \"commit_sha\": \"${{ github.sha }}\",\n \"ref\": \"${{ github.ref }}\",\n \"sarif\": \"$encoded_sarif\",\n \"checkout_uri\": \"https://github.com/${{ github.repository }}\",\n \"tool_name\": \"TruffleHog\"\n }" |
0 commit comments