Debian Codegraph @

.github/workflows/security.yaml

raw symbols SCIP
1 name: Run Security Checks
2 on:
3 push:
4 branches: [main]
5 pull_request:
6 branches: [main]
7 paths:
8 - internal/**
9 - pkg/**
10 - shoutrrr/**
11 - go.mod
12 - go.sum
13 - shoutrrr.go
14 schedule:
15 - cron: "0 0 * * *"
16
17 env:
18 OUTPUT_FILE: results.sarif
19
20 permissions:
21 contents: read # Set default read-only permissions
22
23 jobs:
24 gosec:
25 name: Run gosec Scanner
26 runs-on: ubuntu-latest
27 permissions:
28 contents: read
29 security-events: write
30 steps:
31 - name: Harden the Runner (Step Security)
32 uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
33 with:
34 egress-policy: audit
35
36 - name: Checkout Repo
37 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
38 with:
39 persist-credentials: false
40
41 - name: Run Gosec Security Scanner
42 uses: securego/gosec@9e75c0576c9878035d4221392108d458abe10fc3 # v2.28.0
43 with:
44 args: "-exclude-generated -no-fail -fmt sarif -out ${{ env.OUTPUT_FILE }} ./..."
45
46 - name: Upload SARIF file
47 uses: github/codeql-action/upload-sarif@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
48 with:
49 sarif_file: ${{ env.OUTPUT_FILE }}
50 category: gosec-sarif
51
52 govulncheck:
53 name: Run govulncheck Scanner
54 runs-on: ubuntu-latest
55 permissions:
56 contents: read
57 security-events: write
58 steps:
59 - name: Harden the Runner (Step Security)
60 uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
61 with:
62 egress-policy: audit
63
64 - name: Run govulncheck
65 id: govulncheck
66 uses: nicholas-fedor/govulncheck-action@2e8328bfd2a2259f6b48ad47edc8101c86e74883 # v1.0.5
67 with:
68 output-format: sarif
69 output-file: ${{ env.OUTPUT_FILE }}
70 go-version-file: "go.mod"
71
72 - name: Upload SARIF file
73 uses: github/codeql-action/upload-sarif@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
74 with:
75 sarif_file: ${{ env.OUTPUT_FILE }}
76 category: govulncheck-sarif