-
Notifications
You must be signed in to change notification settings - Fork 38
49 lines (49 loc) · 1.36 KB
/
gosec.yaml
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
---
name: Go Test on Pull Requests
on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- '**.go'
workflow_dispatch:
jobs:
gosec:
name: Check GO security
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: Run Gosec Security Scanner
id: gosec
uses: securego/gosec@master
with:
args: -exclude-generated ./...
env:
GOROOT: ""
continue-on-error: true
- name: Run Gosec Security Scanner - save SARIF
id: gosec-sarif
uses: securego/gosec@master
with:
# we let the report trigger a failure using the GitHub Security features.
args: -exclude-generated -fmt sarif -out results.sarif ./...
env:
GOROOT: ""
continue-on-error: true
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
- name: Check gosec result
run: |
if [ "${{ steps.gosec-sarif.outcome }}" != "success" ]
then
echo "Gosec failed. The errors and warnings should be displayed in the PR."
exit 1
fi