Files
go-test-sarif/.github/workflows/test.yml
renovate[bot] bafa8c3f80 chore(deps): update golangci/golangci-lint-action action (v9.1.0 → v9.2.0) (#74)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 16:47:47 +02:00

47 lines
1.2 KiB
YAML

---
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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: "go.mod"
- name: Install golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.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@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
with:
sarif_file: go-test-results.sarif