Skip to content

Commit

Permalink
ci: add trivy workflow (#87)
Browse files Browse the repository at this point in the history
* chore: switch from asdf to mise

* ci: add trivy to ci workflow

* ci: set GOTOOLCHAIN to local

* chore: Remove GOTOOLCHAIN environment variable from ci.yaml
  • Loading branch information
nobbs authored Jul 18, 2024
1 parent 8f62563 commit f639d29
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
1 change: 0 additions & 1 deletion .envrc

This file was deleted.

33 changes: 32 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
Expand Down Expand Up @@ -55,6 +54,38 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

trivy:
runs-on: ubuntu-latest

permissions:
contents: read
security-events: write
actions: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Download Go modules
run: go mod download

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
scan-type: "fs"
format: "sarif"
output: "trivy-results.sarif"

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

build:
runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
go = "1.22.5"
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

0 comments on commit f639d29

Please sign in to comment.