bazel: Don't run no-op commands

Change-Id: I0b40515932944798eef83f86a64ff99124934978
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/206630
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Erik Gilling <konkers@google.com>
diff --git a/recipe_modules/bazel/api.py b/recipe_modules/bazel/api.py
index 7af9ed6..6c77bcd 100644
--- a/recipe_modules/bazel/api.py
+++ b/recipe_modules/bazel/api.py
@@ -98,9 +98,13 @@
     def run(self, **kwargs) -> None:
         name: str = ' '.join(['bazel'] + list(self.options.args))
         with self.api.context(cwd=self.checkout_root):
-            self.api.step(name, [self.ensure(), *self.options.args], **kwargs)
+            if self.options.args:
+                self.api.step(
+                    name, [self.ensure(), *self.options.args], **kwargs
+                )
 
             for invocation in self.options.invocations:
+                assert invocation.args
                 name: str = ' '.join(['bazel'] + list(invocation.args))
                 self.api.step(name, [self.ensure(), *invocation.args], **kwargs)