Check for Vulnerabilities #48
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: Check for Vulnerabilities | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 9 * * 1" | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| check-for-vulnerabilities: | |
| name: Check for Vulnerabilities | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Run govulncheck and save to file | |
| run: go run golang.org/x/vuln/cmd/govulncheck@latest -format sarif ./... > govulncheck.sarif | |
| - name: Fix duplicate CVE tags in SARIF (workaround for golang/go#75890) | |
| run: | | |
| jq '.runs[]?.tool.driver.rules[]?.properties.tags |= unique' \ | |
| govulncheck.sarif > govulncheck-clean.sarif | |
| mv govulncheck-clean.sarif govulncheck.sarif | |
| - name: Upload SARIF File | |
| uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 | |
| with: | |
| sarif_file: govulncheck.sarif | |
| category: govulncheck |