Skip to content

Commit 063c593

Browse files
committed
feat(docker-build): add step to read Trivy report for pull request comments
1 parent fbacaeb commit 063c593

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/docker-build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ jobs:
9595
hide-progress: true
9696
output: trivy.txt
9797

98+
- name: Read Trivy report file
99+
id: read_trivy
100+
if: github.event_name == 'pull_request' && inputs.security-scan && inputs.security-report == 'comment'
101+
run: |
102+
echo "report<<EOF" >> "$GITHUB_OUTPUT"
103+
cat trivy.txt >> "$GITHUB_OUTPUT"
104+
echo "EOF" >> "$GITHUB_OUTPUT"
105+
98106
- name: Find existing Trivy comment
99107
if: github.event_name == 'pull_request' && inputs.security-scan && inputs.security-report == 'comment'
100108
id: find_trivy
@@ -118,7 +126,7 @@ jobs:
118126
<details><summary>Click to expand detailed results</summary>
119127
120128
```bash
121-
${{ steps.trivy.outputs.report }}
129+
${{ steps.read_trivy.outputs.report }}
122130
```
123131
</details>
124132

0 commit comments

Comments
 (0)