File tree Expand file tree Collapse file tree 8 files changed +57
-12
lines changed Expand file tree Collapse file tree 8 files changed +57
-12
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ permissions:
6
6
jobs :
7
7
go-version :
8
8
name : Lookup go versions
9
- runs-on : ubuntu-latest
9
+ runs-on : ubuntu-22.04
10
10
outputs :
11
11
minimal : ${{ steps.go-version.outputs.minimal }}
12
12
matrix : ${{ steps.go-version.outputs.matrix }}
17
17
go_generate :
18
18
name : Check generated code is up to date
19
19
needs : go-version
20
- runs-on : ubuntu-latest
20
+ runs-on : ubuntu-22.04
21
21
env :
22
22
workdir : go/src/${{ github.repository }}
23
23
steps :
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ permissions:
16
16
jobs :
17
17
analyse :
18
18
name : Analyse
19
- runs-on : ubuntu-latest
19
+ runs-on : ubuntu-22.04
20
20
21
21
steps :
22
22
- name : Checkout repository
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ permissions:
6
6
7
7
jobs :
8
8
dependency-review :
9
- runs-on : ubuntu-latest
9
+ runs-on : ubuntu-22.04
10
10
steps :
11
11
- name : ' Checkout Repository'
12
12
uses : actions/checkout@v3
Original file line number Diff line number Diff line change 7
7
security-scan :
8
8
name : Docker build and scan
9
9
if : ' !github.event.deleted'
10
- runs-on : ubuntu-latest
10
+ runs-on : ubuntu-22.04
11
11
steps :
12
12
- uses : actions/checkout@v3
13
13
- name : Set up Docker Buildx
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ permissions:
7
7
jobs :
8
8
dockerfile :
9
9
name : dockerfile
10
- runs-on : ubuntu-latest
10
+ runs-on : ubuntu-22.04
11
11
steps :
12
12
- uses : actions/checkout@v3
13
13
- name : Run hadolint
@@ -17,15 +17,15 @@ jobs:
17
17
18
18
markdownlint :
19
19
name : markdown
20
- runs-on : ubuntu-latest
20
+ runs-on : ubuntu-22.04
21
21
steps :
22
22
- uses : actions/checkout@v3
23
23
- name : Run markdownlint
24
24
uses : DavidAnson/markdownlint-cli2-action@v11
25
25
26
26
golangci :
27
27
name : lint
28
- runs-on : ubuntu-latest
28
+ runs-on : ubuntu-22.04
29
29
steps :
30
30
- uses : actions/checkout@v3
31
31
- uses : arnested/go-version-action@v1
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ permissions:
13
13
actions : read
14
14
jobs :
15
15
bump-version :
16
- runs-on : ubuntu-latest
16
+ runs-on : ubuntu-22.04
17
17
steps :
18
18
- uses : actions/checkout@v3
19
19
with :
86
86
message : " Released `${{ github.repository }}`@`${{ github.sha }}` as ${{ steps.version.outputs.tag }}: *${{ job.status }}*."
87
87
docker-build :
88
88
name : Docker build and push
89
- runs-on : ubuntu-latest
89
+ runs-on : ubuntu-22.04
90
90
steps :
91
91
- uses : actions/checkout@v3
92
92
- name : Set up Docker Buildx
Original file line number Diff line number Diff line change
1
+ name : Security Checks
2
+ on :
3
+ pull_request :
4
+ branches : [main]
5
+ push :
6
+ branches : [main]
7
+ schedule :
8
+ - cron : ' 0 15 * * 0'
9
+
10
+ permissions :
11
+ contents : read
12
+ actions : read
13
+ pull-requests : read
14
+ security-events : write
15
+
16
+ jobs :
17
+ gosec :
18
+ name : Golang Security Checker
19
+ runs-on : ubuntu-22.04
20
+ env :
21
+ GO111MODULE : on
22
+ steps :
23
+ - name : Checkout Source
24
+ uses : actions/checkout@v3
25
+ - name : Run Gosec Security Scanner
26
+ uses : securego/gosec@master
27
+ with :
28
+ args : ' -no-fail -fmt sarif -out results.sarif -tests ./...'
29
+ - name : Upload SARIF file
30
+ uses : github/codeql-action/upload-sarif@v2
31
+ with :
32
+ # Path to SARIF file relative to the root of the repository
33
+ sarif_file : results.sarif
34
+ govulncheck :
35
+ name : Govulncheck
36
+ runs-on : ubuntu-22.04
37
+ steps :
38
+ - id : govulncheck
39
+ uses : golang/govulncheck-action@master
40
+ with :
41
+ go-version-file : go.mod
Original file line number Diff line number Diff line change 6
6
"fmt"
7
7
"net/http"
8
8
"os"
9
+ "time"
9
10
10
11
"github.com/elnormous/contenttype"
11
12
)
@@ -20,10 +21,13 @@ func main() {
20
21
doHealthcheck (ctx )
21
22
}
22
23
23
- addr := getAddr ()
24
+ server := & http.Server {
25
+ Addr : getAddr (),
26
+ ReadHeaderTimeout : 3 * time .Second ,
27
+ }
24
28
25
29
http .HandleFunc ("/" , handler )
26
- err := http .ListenAndServe (addr , nil )
30
+ err := server .ListenAndServe ()
27
31
if err != nil {
28
32
fmt .Print (err )
29
33
}
You can’t perform that action at this time.
0 commit comments