Skip to content

Commit f15e612

Browse files
authored
chore: update jq cmd in workflow (#2791)
Update `govulncheck` command only output vulnerability findings in workflow.
1 parent 3f6d477 commit f15e612

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

.github/workflows/govulcheck.yaml.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,13 @@ jobs:
2323
id: govulncheck-scan
2424
run: |
2525
# Run with -json (which never fails) and save to a file
26-
govulncheck -json ./... > results.json
26+
govulncheck -json ./... | jq 'select(.finding)' > results.json
2727
# Count the number of findings using jq.
2828
COUNT=$(jq -s 'length' results.json)
2929
echo "Found $COUNT vulnerabilities."
3030
# Set an output for the next steps to use
3131
echo "vuln_count=$COUNT" >> $GITHUB_OUTPUT
32-
- name: Upload scan results artifact
33-
if: steps.govulncheck-scan.outputs.vuln_count > 0
34-
uses: actions/upload-artifact@v4
35-
with:
36-
name: govulncheck-results-json
37-
path: results.json
38-
retention-days: 7
32+
cat results.json
3933
- name: Create GitHub Issue (if vulns found)
4034
if: steps.govulncheck-scan.outputs.vuln_count > 0
4135
env:

0 commit comments

Comments
 (0)