Ensure LUCI branch is set on documentation deployment.

This environment variable is required to set footer of the documentation
correctly.

Bug: https://github.com/flutter/flutter/issues/117157
Change-Id: I24aa3e0984155695273a3e78c058955fa404dafe
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/37505
Reviewed-by: Drew Roen <drewroen@google.com>
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
diff --git a/recipe_modules/adhoc_validation/api.py b/recipe_modules/adhoc_validation/api.py
index a1b6e9f..7ca0fd9 100644
--- a/recipe_modules/adhoc_validation/api.py
+++ b/recipe_modules/adhoc_validation/api.py
@@ -96,6 +96,8 @@
             git_ref = self.m.properties.get('release_ref') or self.m.buildbucket.gitiles_commit.ref
             if ((self.m.properties.get('git_branch') in ['master', 'main']) or
                 (git_ref == 'refs/heads/stable')):
+              # Post-processing of docs require LUCI_BRANCH to be set.
+              env['LUCI_BRANCH'] = 'stable'
               self.m.firebase.deploy_docs(
                   env=env,
                   env_prefixes=env_prefixes,
diff --git a/recipe_modules/adhoc_validation/examples/full.expected/linux.json b/recipe_modules/adhoc_validation/examples/full.expected/linux.json
index c55128e..99ca480 100644
--- a/recipe_modules/adhoc_validation/examples/full.expected/linux.json
+++ b/recipe_modules/adhoc_validation/examples/full.expected/linux.json
@@ -362,7 +362,7 @@
       "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
       "GCP_PROJECT": "myproject",
       "GIT_BRANCH": "main",
-      "LUCI_BRANCH": "",
+      "LUCI_BRANCH": "stable",
       "LUCI_CI": "True",
       "LUCI_PR": "",
       "OS": "linux",
@@ -391,7 +391,7 @@
       "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
       "GCP_PROJECT": "myproject",
       "GIT_BRANCH": "main",
-      "LUCI_BRANCH": "",
+      "LUCI_BRANCH": "stable",
       "LUCI_CI": "True",
       "LUCI_PR": "",
       "OS": "linux",