-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (50 loc) · 1.35 KB
/
security.yml
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
---
name: Security Checks
on:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: '0 15 * * 0'
permissions:
contents: read
actions: read
pull-requests: read
security-events: write
jobs:
gosec:
name: Golang Security Checker
runs-on: ubuntu-22.04
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/[email protected]
with:
args: '-no-fail -fmt sarif -out results.sarif -tests ./...'
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
govulncheck:
name: Govulncheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: WillAbides/[email protected]
with:
go-version-file: go.mod
- id: govulncheck
uses: golang/[email protected]
with:
output-format: sarif
output-file: results.sarif
- name: Fix SARIF format
run: yq --inplace --output-format json '.runs |= map ({"results":[]} + .)' results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif