cmd/releasebot: add check for "create first minor release milestone" step

The release process now documents the step of creating the first minor
release milestone when issuing a major Go release. That happens before
the 'releasebot -mode=prepare' step.

Add an automated check for this so that we don't need to manually
verify whether it was done or not.

(Future release process improvements may include automatically making
the milestone. That is better suited to be in scope of golang/go#40279.)

Fixes golang/go#44404.

Change-Id: I0ee5ff270ceb66d4dea219aad3c49f77b9d21e2f
Reviewed-on: https://go-review.googlesource.com/c/build/+/294249
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
diff --git a/cmd/releasebot/main.go b/cmd/releasebot/main.go
index d76f12c..49b6e9f 100644
--- a/cmd/releasebot/main.go
+++ b/cmd/releasebot/main.go
@@ -167,7 +167,15 @@
 		}
 		w.NextMilestone, err = getMilestone(nextV)
 		if err != nil {
-			log.Fatalf("cannot find the next GitHub milestone after release %s: %v", w.Version, err)
+			log.Fatalf("cannot find %s, the next GitHub milestone after release %s: %v", nextV, w.Version, err)
+		}
+	}
+	// For major releases (go1.X), also check the "create first minor release milestone"
+	// step in the release process wasn't accidentally missed. See issue 44404.
+	if !w.BetaRelease && !w.RCRelease && strings.Count(w.Version, ".") == 1 {
+		firstMinor := w.Version + ".1"
+		if _, err := getMilestone(firstMinor); err != nil {
+			log.Fatalf("cannot find %s, the first minor release GitHub milestone after major release %s: %v", firstMinor, w.Version, err)
 		}
 	}