Skip to content

Commit ef9ca2a

Browse files
authored
Attempt to fix permissions for trivy scan on main (#867)
While the scan works on PRs, we have permssions related failures for the run on the main branch, this attempts to fix that. Similarly, this moves to always scan the image on main, as a way to double check there are no new blocking CVEs more regularly than just when the image is bumped.
1 parent 7856c23 commit ef9ca2a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ permissions:
1919
# To report GitHub Actions status checks
2020
statuses: write
2121
id-token: write
22+
# upload trivy scan results
23+
security-events: write
2224

2325
on:
2426
push:
@@ -143,6 +145,6 @@ jobs:
143145
name: Trivy scan image for vulnerabilities
144146
needs: files_changed
145147
if: |
146-
needs.files_changed.outputs.trivyscan == 'true'
148+
needs.files_changed.outputs.trivyscan == 'true' || github.event_name != 'pull_request'
147149
uses: ./.github/workflows/trivyscan.yml
148150
secrets: inherit

.github/workflows/trivyscan.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ permissions:
1414
packages: write
1515
# To report GitHub Actions status checks
1616
statuses: write
17+
# upload trivy scan results
18+
security-events: write
1719

1820
jobs:
1921
scan:

0 commit comments

Comments
 (0)