Skip to content

Commit

Permalink
Merge pull request #111 from githubexporter/trivy-permissions
Browse files Browse the repository at this point in the history
Add trivy workflow permissions
  • Loading branch information
henrymcconville authored Apr 30, 2024
2 parents 7ead103 + 8f6f9fa commit 75df6d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/container-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ jobs:
container-scan:
name: Container Scan
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -20,11 +25,12 @@ jobs:
- name: Run Trivy
uses: aquasecurity/trivy-action@master
with:
scan-type: image
image-ref: 'githubexporter/github-exporter:${{ steps.get-current-version.outputs.version }}'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'

0 comments on commit 75df6d5

Please sign in to comment.