Scanning: main #200 #200
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: v2.12.0 | |
| args: --output.sarif.path=results.sarif | |
| - name: Upload SARIF report | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.53.3 | |
| with: | |
| sarif_file: results.sarif | |
| govulncheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up Golang stable | |
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.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: go tool -modfile tools/go.mod govulncheck -format sarif ./... > results.sarif | |
| - name: Upload SARIF report | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3 | |
| with: | |
| sarif_file: results.sarif |