Only update last green commit for main branch (#2043)

diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index ce8b118..2332215 100755
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -3427,19 +3427,20 @@
         )
     )
 
-    pipeline_steps.append({"wait": None, "continue_on_failure": False})
+    if current_branch_is_main_branch():
+        pipeline_steps.append({"wait": None, "continue_on_failure": False})
 
-    pipeline_steps.append(
-        create_step(
-            label="Update last green commit for Bazel",
-            commands=[
-                fetch_bazelcipy_command(),
-                PLATFORMS[DEFAULT_PLATFORM]["python"]
-                + " bazelci.py try_update_last_green_commit",
-            ],
-            platform=DEFAULT_PLATFORM,
+        pipeline_steps.append(
+            create_step(
+                label="Update last green commit for Bazel",
+                commands=[
+                    fetch_bazelcipy_command(),
+                    PLATFORMS[DEFAULT_PLATFORM]["python"]
+                    + " bazelci.py try_update_last_green_commit",
+                ],
+                platform=DEFAULT_PLATFORM,
+            )
         )
-    )
 
 
     print_pipeline_steps(pipeline_steps)