[build] Make git action incrementally correct

Bug: 92506
Change-Id: I4c213f95b266f92c45c75ad76c8cbaf32f3296ee
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/mesa/+/642367
Reviewed-by: Craig Stout <cstout@google.com>
diff --git a/src/BUILD.gn b/src/BUILD.gn
index 40aa2b1..7c0be40 100644
--- a/src/BUILD.gn
+++ b/src/BUILD.gn
@@ -137,5 +137,10 @@
     rebase_path("$target_gen_dir/$output_name"),
   ]
 
+  # Ensure that this action reruns when git HEAD moves
+  inputs += [ ".git/HEAD" ]
+  # The above makes it safe to ignore other .git/* accesses.
+  hermetic_action_ignored_prefixes = [ ".git/" ]
+
   public_configs = [ ":sha1_config" ]
 }