static_checks: Skip commit message

Skip the commit message when looking for 'No-Docs-Update-Reason:'. In
fact, forbid that line from appearing in commit messages.

Change-Id: I12249db9b738ee5224625bd0b0b3f4ff2a2a82f2
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/68222
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
diff --git a/recipe_modules/util/api.py b/recipe_modules/util/api.py
index a88cd56..aed0c78 100644
--- a/recipe_modules/util/api.py
+++ b/recipe_modules/util/api.py
@@ -25,6 +25,7 @@
 class ChangeWithComments(object):
     change = attr.ib()
     details = attr.ib()
+    commit_message = attr.ib()
     comments = attr.ib()
 
 
@@ -56,7 +57,9 @@
         ).json.output
 
         current_revision = details['revisions'][details['current_revision']]
-        comments = [current_revision['commit']['message']]
+        commit_message = current_revision['commit']['message']
+
+        comments = []
 
         for revision in details['revisions'].values():
             if revision.get('description'):
@@ -73,7 +76,7 @@
         for _, comment_data in comments_result.items():
             comments.extend(x['message'] for x in comment_data)
 
-        return ChangeWithComments(change, details, comments)
+        return ChangeWithComments(change, details, commit_message, comments)
 
     def find_matching_comment(self, rx, comments):
         """Find a comment in comments that matches regex object rx."""