diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 8c1994d..fa8936a 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -7,7 +7,7 @@ on: jobs: build-and-push: - uses: liatrio/gh-trusted-builds-workflows/.github/workflows/build-and-push.yaml@v2.0.4 + uses: liatrio/gh-trusted-builds-workflows/.github/workflows/build-and-push.yaml@v2.0.11 permissions: actions: read id-token: write @@ -16,7 +16,7 @@ jobs: pull-requests: read security-scan: needs: [ build-and-push ] - uses: liatrio/gh-trusted-builds-workflows/.github/workflows/scan-image.yaml@v2.0.4 + uses: liatrio/gh-trusted-builds-workflows/.github/workflows/scan-image.yaml@v2.0.11 permissions: id-token: write contents: read @@ -27,7 +27,7 @@ jobs: needs: - build-and-push - security-scan - uses: liatrio/gh-trusted-builds-workflows/.github/workflows/policy-verification.yaml@v2.0.4 + uses: liatrio/gh-trusted-builds-workflows/.github/workflows/policy-verification.yaml@v2.0.11 permissions: id-token: write contents: read @@ -38,7 +38,7 @@ jobs: needs: - build-and-push - policy-verification - uses: liatrio/gh-trusted-builds-workflows/.github/workflows/demo-deploy.yaml@v2.0.4 + uses: liatrio/gh-trusted-builds-workflows/.github/workflows/demo-deploy.yaml@v2.0.11 permissions: id-token: write packages: read diff --git a/go.mod b/go.mod index 7901769..0dcac2d 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/liatrio/gh-trusted-builds-app -go 1.20 +go 1.22.1 -require github.com/google/uuid v1.3.0 +require github.com/google/uuid v1.6.0 diff --git a/go.sum b/go.sum index 3dfe1c9..7790d7c 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= diff --git a/main.go b/main.go index 9fcddc5..35825cb 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,9 @@ package main import ( + "errors" "fmt" + "log" "net/http" "github.com/google/uuid" @@ -9,22 +11,25 @@ import ( func main() { http.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("PONG")) + _, _ = w.Write([]byte("PONG")) }) http.HandleFunc("/id", func(w http.ResponseWriter, r *http.Request) { id := uuid.New() - w.Write([]byte(fmt.Sprintf(`{"id": "%s"}`, id.String()))) + _, _ = w.Write([]byte(fmt.Sprintf(`{"id": "%s"}`, id.String()))) }) http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("OK")) + _, _ = w.Write([]byte("OK")) }) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotFound) }) - fmt.Println("Starting server on :8080") - http.ListenAndServe(":8080", nil) + log.Println("Starting server on :8080") + err := http.ListenAndServe(":8080", nil) + if err != nil && !errors.Is(err, http.ErrServerClosed) { + log.Fatalln("error starting server:", err) + } } diff --git a/renovate.json b/renovate.json index 8378844..cd4824f 100644 --- a/renovate.json +++ b/renovate.json @@ -6,5 +6,7 @@ ":semanticCommitTypeAll(build)", ":semanticCommitScopeDisabled" ], - "enabledManagers": ["github-actions", "dockerfile", "gomod"] + "postUpdateOptions": [ + "gomodTidy" + ] }