Skip to content

Commit 840deb4

Browse files
authored
Browse scan reports without GitHub Advanced Security license (#328)
1 parent 0f287db commit 840deb4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,35 @@ jobs:
522522
sarif_file: 'trivy-results.sarif'
523523
```
524524

525+
### Using Trivy if you don't have code scanning enabled
526+
527+
It's also possible to browse a scan result in a workflow summary.
528+
529+
This step is especially useful for private repositories without [GitHub Advanced Security](https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security) license.
530+
531+
```yaml
532+
- name: Run Trivy scanner
533+
uses: aquasecurity/trivy-action@master
534+
with:
535+
scan-type: config
536+
hide-progress: true
537+
output: trivy.txt
538+
539+
- name: Publish Trivy Output to Summary
540+
run: |
541+
if [[ -s trivy.txt ]]; then
542+
{
543+
echo "### Security Output"
544+
echo "<details><summary>Click to expand</summary>"
545+
echo ""
546+
echo '```terraform'
547+
cat trivy.txt
548+
echo '```'
549+
echo "</details>"
550+
} >> $GITHUB_STEP_SUMMARY
551+
fi
552+
```
553+
525554
## Customizing
526555

527556
Configuration priority:

0 commit comments

Comments
 (0)