--- name: Run Go Tests and Generate SARIF on: push: branches: - main pull_request: permissions: read-all jobs: test: runs-on: ubuntu-latest permissions: contents: read security-events: write steps: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version-file: "go.mod" - name: Install golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: version: latest - name: Run Linters run: | go vet ./... golangci-lint run - name: Run Go Tests shell: bash run: go test -json ./... > go-test-results.json - name: Convert JSON to SARIF run: go run ./cmd/main.go go-test-results.json go-test-results.sarif - name: Upload SARIF to GitHub Security Tab uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 with: sarif_file: go-test-results.sarif