-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.61 KB
/
Copy pathgo-security.yml
File metadata and controls
61 lines (51 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: gsec, govul, godep,
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *' # Daily at midnight
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
security-scan:
name: Security & Quality
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: true
- name: Check dependency metadata
run: go mod tidy -diff
- name: Run golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.12.2
args: --timeout=5m
- name: Run govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@v1.7.0
govulncheck ./...
- name: Run Gosec Security Scanner
if: ${{ always() }}
run: |
go run github.com/securego/gosec/v2/cmd/gosec@v2.28.0 \
-no-fail -fmt sarif -out results.sarif ./...
- name: Upload Gosec SARIF file
uses: github/codeql-action/upload-sarif@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
if: ${{ always() && hashFiles('results.sarif') != '' }}
with:
sarif_file: results.sarif