Skip to content

Commit fd419ca

Browse files
committed
Refactor Trivy workflow for improved readability and maintainability
1 parent 1b9fcf7 commit fd419ca

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

.github/workflows/trivy.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
---
2-
name: trivy
2+
name: trivy
33

4-
on:
5-
pull_request:
6-
types: [ 'opened', 'reopened', 'synchronize' ]
7-
merge_group:
8-
workflow_dispatch:
4+
on:
5+
pull_request:
6+
types: [ 'opened', 'reopened', 'synchronize' ]
7+
merge_group:
8+
workflow_dispatch:
99

10-
jobs:
11-
build:
12-
name: 'trivy scan'
13-
runs-on: ubuntu-latest
14-
permissions:
15-
security-events: write
16-
contents: read
10+
jobs:
11+
build:
12+
name: 'trivy scan'
13+
runs-on: ubuntu-latest
14+
permissions:
15+
security-events: write
16+
contents: read
1717

18-
steps:
19-
- name: Harden Runner
20-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
21-
with:
22-
egress-policy: audit
18+
steps:
19+
- name: Harden Runner
20+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
21+
with:
22+
egress-policy: audit
2323

24-
- name: Checkout code
25-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- name: Checkout code
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626

27-
- name: Run Trivy vulnerability scanner (file system)
28-
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.29.0
29-
with:
30-
scan-type: 'fs'
31-
ignore-unfixed: true
32-
scan-ref: .
33-
format: 'sarif'
34-
scanners: 'vuln,secret,config'
35-
output: report-fs.sarif
27+
- name: Run Trivy vulnerability scanner (file system)
28+
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.29.0
29+
with:
30+
scan-type: 'fs'
31+
ignore-unfixed: true
32+
scan-ref: .
33+
format: 'sarif'
34+
scanners: 'vuln,secret,config'
35+
output: report-fs.sarif
3636

37-
- name: Upload Trivy report (fs) GitHub Security
38-
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
39-
with:
40-
sarif_file: report-fs.sarif
41-
category: 'fs'
37+
- name: Upload Trivy report (fs) GitHub Security
38+
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
39+
with:
40+
sarif_file: report-fs.sarif
41+
category: 'fs'

0 commit comments

Comments
 (0)