1111 branches :
1212 - master
1313
14- # Declare default permissions as read only.
14+ # Declare default permissions as read- only.
1515permissions : read-all
1616
1717jobs :
18+ GolangCI :
19+ runs-on : ubuntu-latest
20+ permissions :
21+ contents : read
22+ security-events : write
23+ steps :
24+ - name : Harden Runner
25+ uses : step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
26+ with :
27+ egress-policy : audit
28+
29+ - name : Checkout
30+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+ with :
32+ fetch-depth : 1
33+
34+ - name : Run golangci-lint
35+ uses : golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
36+ with :
37+ version : latest
38+ args : --timeout=5m --output.sarif.path=golangci-lint-results.sarif --output.text.path=stdout
39+
40+ - name : Upload golangci-lint results to GitHub Security tab
41+ uses : github/codeql-action/upload-sarif@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5
42+ with :
43+ sarif_file : golangci-lint-results.sarif
44+
1845 TrivyCode :
1946 runs-on : ubuntu-latest
2047 permissions :
48+ contents : read
2149 security-events : write
2250 steps :
2351 - name : Harden Runner
@@ -28,14 +56,14 @@ jobs:
2856 - name : Checkout code
2957 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3058
31- - name : Run Trivy vulnerability scanner in repo mode
32- uses : aquasecurity/trivy-action@e368e328979b113139d6f9068e03accaed98a518 # 0.34.1
59+ - name : Run Trivy vulnerability scanner in fs mode
60+ uses : aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2
3361 with :
3462 scan-type : ' fs'
3563 ignore-unfixed : true
3664 format : ' sarif'
3765 output : ' trivy-results.sarif'
38- severity : ' CRITICAL'
66+ severity : ' CRITICAL,HIGH '
3967
4068 - name : Upload Trivy scan results to GitHub Security tab
4169 uses : github/codeql-action/upload-sarif@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5
@@ -45,38 +73,33 @@ jobs:
4573 VulnerabilityCheck :
4674 runs-on : ubuntu-latest
4775 permissions :
76+ contents : read
4877 security-events : write
4978 steps :
5079 - name : Harden Runner
5180 uses : step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
5281 with :
5382 egress-policy : audit
5483
55- - name : Checkout
56- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57- with :
58- fetch-depth : 1
59-
60- - name : VulnerabilityCheck
84+ - name : Vulnerability Check
6185 uses : golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
6286 with :
63- repo-checkout : false
6487 output-format : sarif
6588 output-file : govulncheck-results.sarif
6689
67- - name : PrintSarif
90+ - name : Print Sarif
91+ id : printSarif
6892 run : |
6993 cat govulncheck-results.sarif
70-
71- if grep "'results'" govulncheck-results.serif
94+ if grep results govulncheck-results.sarif
7295 then
7396 echo "hasResults=true" >> $GITHUB_OUTPUT
7497 else
7598 echo "hasResults=false" >> $GITHUB_OUTPUT
7699 fi
77100
78- - name : Upload govulncheck results to GitHub Security tab
79- if : ${{ steps.PrintSarif .outputs.hasResults == 'true' }}
101+ - name : Upload govulncheck results to Security tab
102+ if : ${{ steps.printSarif .outputs.hasResults == 'true' }}
80103 uses : github/codeql-action/upload-sarif@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5
81104 with :
82105 sarif_file : govulncheck-results.sarif
0 commit comments