static_checks: Only check run_mode if CQ is active

Change-Id: Iabd014a25bdb9afda754e9ce3986c23477e41050
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/164110
Commit-Queue: Rob Mohr <mohrr@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Anthony Fandrianto <atyfto@google.com>
diff --git a/recipes/static_checks.py b/recipes/static_checks.py
index a56f2d6..fc9ad09 100644
--- a/recipes/static_checks.py
+++ b/recipes/static_checks.py
@@ -93,7 +93,7 @@
         '"No-Docs-Update-Reason: <reason>".'
     )
 
-    if api.cq.run_mode == api.cq.NEW_PATCHSET_RUN:
+    if api.cq.active and api.cq.run_mode == api.cq.NEW_PATCHSET_RUN:
         with api.step.nest('failure') as pres:
             pres.status == 'FAILURE'
             pres.step_summary_text = error