brand exe with both long and short commit hashes
1 file changed, 2 insertions(+), 4 deletions(-)
changed files
M cmd/server/server.go → cmd/server/server.go
@@ -19,8 +19,6 @@ sentryhttp "github.com/getsentry/sentry-go/http" "github.com/shengyanli1982/law" ) -var Commit string - var config *cfg.Config type HTTPError struct {@@ -71,7 +69,7 @@ w.WriteHeader(http.StatusInternalServerError) slog.Error("runtime panic!", "error", fail) } }() - w.Header().Set("Server", fmt.Sprintf("website (%s)", Commit)) + w.Header().Set("Server", fmt.Sprintf("website (%s)", ShortSHA)) if err := fn(w, r); err != nil { if strings.Contains(r.Header.Get("Accept"), "text/html") { w.WriteHeader(err.Code)@@ -119,7 +117,7 @@ err = sentry.Init(sentry.ClientOptions{ EnableTracing: true, TracesSampleRate: 1.0, Dsn: os.Getenv("SENTRY_DSN"), - Release: Commit, + Release: CommitSHA, Environment: env, }) if err != nil {