Skip slsa updates only for the orphaned versions

This commit is contained in:
David Dworken 2022-11-01 10:51:08 -07:00
parent add3693967
commit d2558c8fb5
No known key found for this signature in database

View File

@ -566,7 +566,21 @@ func apiDownloadHandler(w http.ResponseWriter, r *http.Request) {
func slsaStatusHandler(w http.ResponseWriter, r *http.Request) {
// returns "OK" unless there is a current SLSA bug
v := getHishtoryVersion(r)
if !strings.Contains(v, "v0.") {
w.Write([]byte("OK"))
return
}
vNum, err := strconv.Atoi(strings.Split(v, ".")[1])
if err != nil {
w.Write([]byte("OK"))
return
}
if vNum < 158 {
w.Write([]byte("Sigstore deployed a broken change. See https://github.com/slsa-framework/slsa-github-generator/issues/1163"))
return
}
w.Write([]byte("OK"))
}
type loggedResponseData struct {