project.config: require a matching subject prefix on release branches

The prefixsubject operator is new to Gerrit 3.8.0 and might help with
this issue. There's room for future improvement as this doesn't catch
CLs to the main branch or release branch mix ups (e.g., 1.21 vs 1.22).

For go.dev/issue/41722.

Change-Id: I4b9971085b5a4377b94b8e6418cee1632fff5a73
Reviewed-on: https://go-review.googlesource.com/c/All-Projects/+/537477
Reviewed-by: Heschi Kreinick <heschi@google.com>
diff --git a/project.config b/project.config
index 656877c..e389fa7 100644
--- a/project.config
+++ b/project.config
@@ -221,3 +221,8 @@
 	applicableIf = hashtag:wait-release
 	submittableIf = is:false
 	canOverrideInChildProjects = true
+[submit-requirement "Matching-Subject-Prefix"]
+	description = Changes on release branches must have a matching [release-branch.go1.nn] subject prefix.
+	applicableIf = branch:\"^refs/heads/release-branch.+\" -prefixsubject:\"[release-branch\"
+	submittableIf = is:false
+	canOverrideInChildProjects = true