Scanning: main #175 #175
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: Code scanning | |
| run-name: "Scanning: ${{ github.event.pull_request.number || format('{0} #{1}', github.ref_name, github.run_number) }}" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| golangci-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: v2.12.1 | |
| args: --output.sarif.path=results.sarif | |
| - name: Upload SARIF report | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.53.3 | |
| with: | |
| sarif_file: results.sarif | |
| govulncheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up Golang stable | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version: stable | |
| cache: false | |
| - name: Checksum | |
| id: checksum | |
| run: | | |
| checksum=$( | |
| { | |
| sha256sum tools/go.mod tools/go.sum | |
| find . -type f -name "*.go" -print0 | sort -z | xargs -0 sha256sum | |
| } | sha256sum | awk '{print $1}' | |
| ) | |
| echo "checksum=$checksum" >> "$GITHUB_OUTPUT" | |
| - name: Cache Go module cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: govulncheck-go-mod-${{ hashFiles('tools/go.sum') }} | |
| - name: Cache Go build cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.cache/go-build | |
| key: govulncheck-go-build-${{ steps.checksum.outputs.checksum }} | |
| restore-keys: | | |
| govulncheck-go-build- | |
| - name: Run govulncheck | |
| run: make static-analysis/vulncheck/sarif | |
| - name: Upload SARIF report | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.53.3 | |
| with: | |
| sarif_file: build/vulncheck.sarif |