Go vulnerability check #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Go vulnerability check | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # daily at 06:00 UTC | |
| pull_request: | |
| paths: | |
| - 'go.mod' | |
| - 'go.sum' | |
| workflow_dispatch: {} | |
| permissions: | |
| security-events: write | |
| jobs: | |
| govulncheck: | |
| name: govulncheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: ./go.mod | |
| - name: Install govulncheck | |
| run: go install golang.org/x/vuln/cmd/govulncheck@latest | |
| - name: Run govulncheck (SARIF) | |
| id: scan | |
| continue-on-error: true | |
| run: govulncheck -format sarif ./... > govulncheck.sarif | |
| - name: Upload SARIF file | |
| uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 | |
| with: | |
| sarif_file: govulncheck.sarif | |
| - name: Run govulncheck (text) | |
| if: ${{ steps.scan.outcome == 'failure' }} | |
| run: | | |
| echo "::error::govulncheck found vulnerabilities in Go dependencies" | |
| govulncheck ./... |