Skip to content

Commit 7bb99d0

Browse files
authored
chore: only upload trivy results for main branch (#110)
- Fix codeql warning.
1 parent eb88b66 commit 7bb99d0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/ci.yaml

+10-5
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ jobs:
189189
- name: build image
190190
run: make -j build/image/envbox
191191

192+
# We don't want to run Trivy on pull requests.
193+
- name: Exit if not on main
194+
if: github.ref != 'refs/heads/main'
195+
run: exit 0
196+
192197
- name: Run Trivy vulnerability scanner
193198
uses: aquasecurity/[email protected]
194199
with:
@@ -215,11 +220,6 @@ jobs:
215220
steps:
216221
- uses: actions/checkout@v3
217222

218-
- name: Initialize CodeQL
219-
uses: github/codeql-action/init@v2
220-
with:
221-
languages: go
222-
223223
- name: Setup Go
224224
uses: actions/setup-go@v3
225225
with:
@@ -236,6 +236,11 @@ jobs:
236236
path: ${{ steps.go-cache-paths.outputs.GOMODCACHE }}
237237
key: ${{ runner.os }}-release-go-mod-${{ hashFiles('**/go.sum') }}
238238

239+
- name: Initialize CodeQL
240+
uses: github/codeql-action/init@v2
241+
with:
242+
languages: go
243+
239244
- name: Perform CodeQL Analysis
240245
uses: github/codeql-action/analyze@v2
241246

0 commit comments

Comments
 (0)