Update references for recently renamed github branches.

https://github.com/bazelbuild/bazel/issues/12200

RELNOTES: None
PiperOrigin-RevId: 384279391
diff --git a/site/docs/integrating-with-rules-cc.md b/site/docs/integrating-with-rules-cc.md
index 0fccc1d..e6735d0 100644
--- a/site/docs/integrating-with-rules-cc.md
+++ b/site/docs/integrating-with-rules-cc.md
@@ -26,7 +26,7 @@
 to get the
 [`CcToolchainInfo`](https://docs.bazel.build/versions/main/skylark/lib/CcToolchainInfo.html).
 A complete working example can be found
-[in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/master/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl).
+[in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/main/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl).
 
 ## Generating command lines and environment variables using the C++ toolchain
 
@@ -54,7 +54,7 @@
 eventually be removed.
 
 A complete working example can be found
-[in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/master/examples/my_c_compile/my_c_compile.bzl).
+[in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/main/examples/my_c_compile/my_c_compile.bzl).
 
 ## Implementing Starlark rules that depend on C++ rules and/or that C++ rules can depend on
 
@@ -76,7 +76,7 @@
 it should wrap it in, for example, `JavaCcInfo`.
 
 A complete working example can be found
-[in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/master/examples/my_c_archive/my_c_archive.bzl).
+[in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/main/examples/my_c_archive/my_c_archive.bzl).
 
 
 ## Reusing logic and actions of C++ rules
diff --git a/site/docs/remote-execution-rules.md b/site/docs/remote-execution-rules.md
index 562af47..4159591 100644
--- a/site/docs/remote-execution-rules.md
+++ b/site/docs/remote-execution-rules.md
@@ -10,7 +10,7 @@
 remote execution.
 
 Remote execution allows Bazel to execute actions on a separate platform, such as
-a datacenter. A [gRPC protocol](https://github.com/bazelbuild/remote-apis/blob/master/build/bazel/remote/execution/v2/remote_execution.proto)
+a datacenter. A [gRPC protocol](https://github.com/bazelbuild/remote-apis/blob/main/build/bazel/remote/execution/v2/remote_execution.proto)
 is currently in development. You can try remote execution with [bazel-buildfarm](https://github.com/bazelbuild/bazel-buildfarm),
 an open-source project that aims to provide a distributed remote execution
 platform.
@@ -57,7 +57,7 @@
 Toolchain rules currently exist for Bazel build and test rules for
 [Scala](https://github.com/bazelbuild/rules_scala/blob/master/scala/scala_toolch
 ain.bzl),
-[Rust](https://github.com/bazelbuild/rules_rust/blob/master/rust/toolchain.bzl),
+[Rust](https://github.com/bazelbuild/rules_rust/blob/main/rust/toolchain.bzl),
 and [Go](https://github.com/bazelbuild/rules_go/blob/master/go/toolchains.rst),
 and new toolchain rules are under way for other languages and tools such as
 [bash](https://docs.google.com/document/d/e/2PACX-1vRCSB_n3vctL6bKiPkIa_RN_ybzoAccSe0ic8mxdFNZGNBJ3QGhcKjsL7YKf-ngVyjRZwCmhi_5KhcX/pub).
diff --git a/site/docs/skylark/depsets.md b/site/docs/skylark/depsets.md
index 9f93d82..193fd23 100644
--- a/site/docs/skylark/depsets.md
+++ b/site/docs/skylark/depsets.md
@@ -36,7 +36,7 @@
 
 
 This example is available at
-[https://github.com/bazelbuild/examples/tree/HEAD/rules/depsets](https://github.com/bazelbuild/examples/tree/master/rules/depsets).
+[https://github.com/bazelbuild/examples/tree/HEAD/rules/depsets](https://github.com/bazelbuild/examples/tree/main/rules/depsets).
 
 Suppose there is a hypothetical interpreted language Foo. In order to build
 each `foo_binary` you need to know all the `*.foo` files that it directly or
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md
index f52654b..9d90c04 100644
--- a/site/docs/skylark/rules.md
+++ b/site/docs/skylark/rules.md
@@ -629,9 +629,9 @@
 customizing the executable file's name at analysis time.
 
 See examples of an
-[executable rule](https://github.com/bazelbuild/examples/blob/master/rules/executable/fortune.bzl)
+[executable rule](https://github.com/bazelbuild/examples/blob/main/rules/executable/fortune.bzl)
 and a
-[test rule](https://github.com/bazelbuild/examples/blob/master/rules/test_rule/line_length.bzl).
+[test rule](https://github.com/bazelbuild/examples/blob/main/rules/test_rule/line_length.bzl).
 
 [Executable rules](be/common-definitions.html#common-attributes-binaries) and
 [test rules](be/common-definitions.html#common-attributes-tests) have additional
@@ -757,7 +757,7 @@
 If a dependency attribute has the flag `executable=True`, `cfg` must be set
 explicitly. This is to guard against accidentally building a tool for the wrong
 configuration.
-[See example](https://github.com/bazelbuild/examples/blob/master/rules/actions_run/execute.bzl)
+[See example](https://github.com/bazelbuild/examples/blob/main/rules/actions_run/execute.bzl)
 
 In general, sources, dependent libraries, and executables that will be needed at
 runtime can use the same configuration.
diff --git a/site/docs/tutorial/android-app.md b/site/docs/tutorial/android-app.md
index dbfc7c7..17accf7 100644
--- a/site/docs/tutorial/android-app.md
+++ b/site/docs/tutorial/android-app.md
@@ -53,7 +53,7 @@
 width="700">
 
 Clone the repository with `git` (or [download the ZIP file
-directly](https://github.com/bazelbuild/examples/archive/master.zip)):
+directly](https://github.com/bazelbuild/examples/archive/main.zip)):
 
 ``` bash
 git clone https://github.com/bazelbuild/examples
diff --git a/site/docs/tutorial/ios-app.md b/site/docs/tutorial/ios-app.md
index 6bcf01f..98f3ffc 100644
--- a/site/docs/tutorial/ios-app.md
+++ b/site/docs/tutorial/ios-app.md
@@ -41,9 +41,9 @@
 ### Get the sample project
 
 You also need to get the sample project for the tutorial from GitHub. The GitHub
-repo has two branches: `source-only` and `master`. The `source-only` branch
+repo has two branches: `source-only` and `main`. The `source-only` branch
 contains the source files for the project only. You'll use the files in this
-branch in this tutorial. The `master` branch contains both the source files
+branch in this tutorial. The `main` branch contains both the source files
 and completed Bazel `WORKSPACE` and `BUILD` files. You can use the files in this
 branch to check your work when you've completed the tutorial steps.
 
@@ -235,8 +235,8 @@
 you added to the `BUILD` file above.
 
 Now, save and close the file. You can compare your `BUILD` file to the
-[completed example](https://github.com/bazelbuild/examples/blob/master/tutorial/ios-app/BUILD)
-in the `master` branch of the GitHub repo.
+[completed example](https://github.com/bazelbuild/examples/blob/main/tutorial/ios-app/BUILD)
+in the `main` branch of the `GitHub repo.
 
 ## Build and deploy the app
 
@@ -250,7 +250,7 @@
 The built app is located in the `$WORKSPACE/bazel-bin` directory.
 
 Completed `WORKSPACE` and `BUILD` files for this tutorial are located in the
-[master branch](https://github.com/bazelbuild/examples/tree/HEAD/tutorial)
+[main branch](https://github.com/bazelbuild/examples/tree/HEAD/tutorial)
 of the GitHub repo. You can compare your work to the completed files for
 additional help or troubleshooting.
 
@@ -355,6 +355,6 @@
 ## Further reading
 
 For more details, see
-[master branch](https://github.com/bazelbuild/examples/tree/HEAD/tutorial)
+[main branch](https://github.com/bazelbuild/examples/tree/HEAD/tutorial)
 of the GitHub repo.
 
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html
index 9358816..72c1827 100644
--- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html
+++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html
@@ -8,7 +8,7 @@
 the features ["a", "b"] are enabled on the package level, and a target's
 <code>features</code> attribute contains ["-a", "c"], the features enabled for the
 rule will be "b" and "c".
-  <a href="https://github.com/bazelbuild/examples/blob/master/rules/features/BUILD">
+  <a href="https://github.com/bazelbuild/examples/blob/main/rules/features/BUILD">
     See example</a>.
 </p>
 
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm
index 071eed5..a443da7 100644
--- a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm
+++ b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm
@@ -233,7 +233,7 @@
   (see the explanation of <i>output files</i> below).
 </p>
 
-<p><a href="https://github.com/bazelbuild/examples/tree/master/make-variables">
+<p><a href="https://github.com/bazelbuild/examples/tree/main/make-variables">
   See an example of predefined variables</a>.</p>
 
 <ul>
@@ -438,7 +438,7 @@
   <code>toolchains</code> attribute can then read their values:
 </p>
 
-<p><a href="https://github.com/bazelbuild/examples/tree/master/make-variables">
+<p><a href="https://github.com/bazelbuild/examples/tree/main/make-variables">
   See an example of Starlark-defined variables</a>.</p>
 
 #if (!$singlePage)
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java
index d0546d4..97d5661 100644
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java
+++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java
@@ -52,7 +52,7 @@
               + "need to be (and cannot be) declared using this function. You can obtain their "
               + "<code>File</code> objects from "
               + "<a href=\"ctx.html#outputs\"><code>ctx.outputs</code></a> instead. "
-              + "<a href=\"https://github.com/bazelbuild/examples/tree/master/rules/"
+              + "<a href=\"https://github.com/bazelbuild/examples/tree/main/rules/"
               + "computed_dependencies/hash.bzl\">See example of use</a>.",
       parameters = {
         @Param(
@@ -268,7 +268,7 @@
       name = "run",
       doc =
           "Creates an action that runs an executable. "
-              + "<a href=\"https://github.com/bazelbuild/examples/tree/master/rules/"
+              + "<a href=\"https://github.com/bazelbuild/examples/tree/main/rules/"
               + "actions_run/execute.bzl\">See example of use</a>.",
       parameters = {
         @Param(
@@ -453,7 +453,7 @@
       name = "run_shell",
       doc =
           "Creates an action that runs a shell command. "
-              + "<a href=\"https://github.com/bazelbuild/examples/tree/master/rules/"
+              + "<a href=\"https://github.com/bazelbuild/examples/tree/main/rules/"
               + "shell_command/rules.bzl\">See example of use</a>.",
       parameters = {
         @Param(
@@ -658,7 +658,7 @@
               + "result of a previous substitution), it is replaced with the associated value. "
               + "There is no special syntax for the keys. You may, for example, use curly braces "
               + "to avoid conflicts (for example, <code>{KEY}</code>). "
-              + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/"
+              + "<a href=\"https://github.com/bazelbuild/examples/blob/main/rules/"
               + "expand_template/hello.bzl\">"
               + "See example of use</a>.",
       parameters = {
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleContextApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleContextApi.java
index 6aed227..a1d2c3a 100644
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleContextApi.java
+++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleContextApi.java
@@ -71,7 +71,7 @@
           + "attribute is not specified in the rule then the corresponding struct value is "
           + "<code>None</code>. If a label type is not marked as <code>executable=True</code>, no "
           + "corresponding struct field is generated. <a "
-          + "href=\"https://github.com/bazelbuild/examples/blob/master/rules/actions_run/"
+          + "href=\"https://github.com/bazelbuild/examples/blob/main/rules/actions_run/"
           + "execute.bzl\">See example of use</a>.";
   String FILES_DOC =
       "A <code>struct</code> containing files defined in <a href='attr.html#label'>label</a>"
@@ -82,7 +82,7 @@
           + " other words, use <code>files</code> to access the <a"
           + " href=\"../rules.$DOC_EXT#requesting-output-files\">default outputs</a> of a"
           + " dependency. <a"
-          + " href=\"https://github.com/bazelbuild/examples/blob/master/rules/depsets/foo.bzl\">See"
+          + " href=\"https://github.com/bazelbuild/examples/blob/main/rules/depsets/foo.bzl\">See"
           + " example of use</a>.";
   String FILE_DOC =
       "A <code>struct</code> containing files defined in <a href='attr.html#label'>label type"
@@ -97,7 +97,7 @@
           + " <code>file</code> to access the (singular) <a"
           + " href=\"../rules.$DOC_EXT#requesting-output-files\">default output</a> of a"
           + " dependency. <a"
-          + " href=\"https://github.com/bazelbuild/examples/blob/master/rules/expand_template/hello.bzl\">See"
+          + " href=\"https://github.com/bazelbuild/examples/blob/main/rules/expand_template/hello.bzl\">See"
           + " example of use</a>.";
   String ATTR_DOC =
       "A struct to access the values of the <a href='../rules.$DOC_EXT#attributes'>attributes</a>. "
@@ -105,7 +105,7 @@
           + "of the struct and the types of their values correspond to the keys and values of the "
           + "<a href='globals.html#rule.attrs'><code>attrs</code> dict</a> provided to the <a "
           + "href='globals.html#rule'><code>rule</code> function</a>. <a "
-          + "href=\"https://github.com/bazelbuild/examples/blob/master/rules/attributes/"
+          + "href=\"https://github.com/bazelbuild/examples/blob/main/rules/attributes/"
           + "printer.bzl\">See example of use</a>.";
   String SPLIT_ATTR_DOC =
       "A struct to access the values of attributes with split configurations. If the attribute is "
@@ -267,7 +267,7 @@
       structField = true,
       doc =
           "Returns the set of features that are explicitly enabled by the user for this rule. "
-              + "<a href=\"https://github.com/bazelbuild/examples/blob/master/rules/"
+              + "<a href=\"https://github.com/bazelbuild/examples/blob/main/rules/"
               + "features/rule.bzl\">See example of use</a>.")
   ImmutableList<String> getFeatures() throws EvalException;