gerrit: add autosubmit action

This adds a way to adjust the Auto-Submit label from the gerrit
command line tool.

BUG=None
TEST=Mark a CL as Auto-Submit using the action

Change-Id: Ia973173d683e57a9a75f0e9bd9bc78f76adf0eeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1741950
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Auto-Submit: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 8c6265e..250cc9b 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -356,6 +356,17 @@
 UserActInspect.usage = '<CLs...>'
 
 
+def UserActAutosubmit(opts, *args):
+  """Mark CLs with the Auto-Submit label"""
+  num = args[-1]
+  for arg in args[:-1]:
+    helper, cl = GetGerrit(opts, arg)
+    helper.SetReview(cl, labels={'Auto-Submit': num},
+                     dryrun=opts.dryrun, notify=opts.notify)
+UserActAutosubmit.arg_min = 2
+UserActAutosubmit.usage = '<CLs...> <0|1>'
+
+
 def UserActReview(opts, *args):
   """Mark CLs with a code review status"""
   num = args[-1]