Fail to build from source: API rate limit exceeded for 216.228.127.129
@DwarKapex,
Could you please confirm whether this issue is happening with only 2.13 or also with the latest stable tensorflow version 2.16.1. Please try and provide the error log if you are facing with 2.16.1 as well. Thank you This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/64320">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/64320">No</a>

### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.13.0

### Custom code

No

### OS platform and distribution

linux

### Mobile device

_No response_

### Python version

3.9

### Bazel version

5.3.0

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Complete the build without an issue (now it is intermittent because of the root cause below)

THE ACTUAL PROBLEM:

The problem is the `curl` request [here](https://github.com/tensorflow/text/blob/f0f675cb1e24cfd0e42aa95f3136b7aee3c91bc6/oss_scripts/prepare_tf_dep.sh#L38). The API request response is the following:
```
$> curl -s https://api.github.com/repos/tensorflow/tensorflow/commits/1cb1a030                                                                           
{"message":"API rate limit exceeded for 216.228.127.129. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
```

Need a more reliable way to get commit_slug, or IMHO it is better to use commit as a reference.

### Standalone code to reproduce the issue

```shell
$> pip install tensorflow_datasets==4.9.2 auditwheel tensorflow==2.13.0
$> git clone https://github.com/tensorflow/text.git /opt/tensorflow-text
$> cd /opt/tensorflow-text
$> git checkout 917a681d7220ebf9b62a08b6f9ce7b7db886ddef
$> git submodule update --init --recursive
$> ./oss_scripts/run_build.sh
```


### Relevant log output

```shell
+ ./oss_scripts/run_build.sh
++ uname -s
++ tr A-Z a-z
+ osname=linux
+ [[ linux == \d\a\r\w\i\n ]]
+ source oss_scripts/configure.sh
+++ uname -s
+++ tr A-Z a-z
++ osname=linux
++ echo linux
linux
++ '[' -e .bazelrc ']'
+++ pip show tensorflow
Using installed tensorflow.
++ [[ Name: tensorflow
Version: 2.13.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: tensorflow-cpu-aws
Required-by:  == *tensorflow* ]]
++ echo 'Using installed tensorflow.'
++ is_windows
++ [[ linux =~ msys_nt*|mingw*|cygwin*|uwin* ]]
++ curl https://raw.githubusercontent.com/tensorflow/tensorflow/r2.13/.bazelversion -o .bazelversion
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    85  100    85    0     0    992      0 --:--:-- --:--:-- --:--:--  1000
++ curl https://raw.githubusercontent.com/tensorflow/tensorflow/r2.13/.bazelrc -o .bazelrc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 36653  100 36653    0     0   372k      0 --:--:-- --:--:-- --:--:--  376k
++ sed -i -e 's/build --noincompatible_remove_legacy_whole_archive//' .bazelrc
++ write_to_bazelrc 'build:manylinux2010 --config=release_cpu_linux'
++ echo 'build:manylinux2010 --config=release_cpu_linux'
++ write_to_bazelrc 'build:manylinux2014 --config=release_cpu_linux'
++ echo 'build:manylinux2014 --config=release_cpu_linux'
++ which python3
++ grep -q python3
++ installed_python=python3
++ TF_CFLAGS=($($installed_python -c "import tensorflow as tf; print(' '.join(tf.sysconfig.get_compile_flags()))" | awk '{print $1}'))
+++ python3 -c 'import tensorflow as tf; print('\'' '\''.join(tf.sysconfig.get_compile_flags()))'
+++ awk '{print $1}'
++ TF_LFLAGS=($($installed_python -c "import tensorflow as tf; print(' '.join(tf.sysconfig.get_link_flags()))" | awk '{print $1}'))
+++ python3 -c 'import tensorflow as tf; print('\'' '\''.join(tf.sysconfig.get_link_flags()))'
+++ awk '{print $1}'
++ TF_LFLAGS_2=($($installed_python -c "import tensorflow as tf; print(' '.join(tf.sysconfig.get_link_flags()))" | awk '{print $2}'))
+++ python3 -c 'import tensorflow as tf; print('\'' '\''.join(tf.sysconfig.get_link_flags()))'
+++ awk '{print $2}'
+++ python3 -c 'import tensorflow as tf; print(tf.sysconfig.CXX11_ABI_FLAG)'
++ TF_ABIFLAG=1
++ HEADER_DIR=/usr/local/lib/python3.10/dist-packages/tensorflow/include
++ SHARED_LIBRARY_DIR=/usr/local/lib/python3.10/dist-packages/tensorflow
+++ echo -l:libtensorflow_framework.so.2
+++ rev
+++ cut -d: -f1
+++ rev
++ SHARED_LIBRARY_NAME=libtensorflow_framework.so.2
++ is_macos
++ [[ linux == \d\a\r\w\i\n ]]
++ is_windows
++ [[ linux =~ msys_nt*|mingw*|cygwin*|uwin* ]]
++ export LD_LIBRARY_PATH=/opt/amazon/efa/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/lib/python3.10/dist-packages/tensorflow
++ LD_LIBRARY_PATH=/opt/amazon/efa/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/lib/python3.10/dist-packages/tensorflow
++ write_action_env_to_bazelrc TF_HEADER_DIR /usr/local/lib/python3.10/dist-packages/tensorflow/include
++ write_to_bazelrc 'build --action_env TF_HEADER_DIR="/usr/local/lib/python3.10/dist-packages/tensorflow/include"'
++ echo 'build --action_env TF_HEADER_DIR="/usr/local/lib/python3.10/dist-packages/tensorflow/include"'
++ write_action_env_to_bazelrc TF_SHARED_LIBRARY_DIR /usr/local/lib/python3.10/dist-packages/tensorflow
++ write_to_bazelrc 'build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.10/dist-packages/tensorflow"'
++ echo 'build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.10/dist-packages/tensorflow"'
++ write_action_env_to_bazelrc TF_SHARED_LIBRARY_NAME libtensorflow_framework.so.2
++ write_to_bazelrc 'build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"'
++ echo 'build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"'
++ write_action_env_to_bazelrc TF_CXX11_ABI_FLAG 1
++ write_to_bazelrc 'build --action_env TF_CXX11_ABI_FLAG="1"'
++ echo 'build --action_env TF_CXX11_ABI_FLAG="1"'
++ bazel version
++ grep label
++ sed -e 's/.*: //'
2024/03/22 17:33:39 Downloading https://releases.bazel.build/5.3.0/release/bazel-5.3.0-linux-arm64...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
+ installed_bazel_version=5.3.0
++ head -n 1 .bazelversion
+ tf_bazel_version=5.3.0
+ '[' 5.3.0 '!=' 5.3.0 ']'
+ [[ linux != \d\a\r\w\i\n ]]
+ source oss_scripts/prepare_tf_dep.sh
++ set -ex
++ which python3
++ grep -q python3
++ installed_python=python3
++ ext=
+++ uname -s
+++ tr A-Z a-z
++ osname=linux
++ [[ linux == \d\a\r\w\i\n ]]
+++ python3 -c 'import tensorflow as tf; print(tf.__version__)'
++ tf_version=2.13.0
++ echo 2.13.0
2.13.0
++ sed -i 's/project_version = '\''REPLACE_ME'\''/project_version = '\''2.13.0'\''/' oss_scripts/pip_package/setup.nightly.py
++ sed -i 's/__version__ = .*$/__version__ = "2.13.0"/' tensorflow_text/__init__.py
+++ python3 -c 'import tensorflow as tf; print(tf.__git_version__)'
+++ tail -1
++ short_commit_sha=v2.13.0-0-g1cb1a030
++ [[ linux == \d\a\r\w\i\n ]]
+++ echo v2.13.0-0-g1cb1a030
+++ grep -oP '(?<=-g)[0-9a-f]*$'
++ short_commit_sha=1cb1a030
+++ curl -s https://api.github.com/repos/tensorflow/tensorflow/commits/1cb1a030
+++ grep sha
+++ head -n 1
+++ cut -d '"' -f 4
++ commit_sha=
++ sed -E -i 's/strip_prefix = "tensorflow-2.+",/strip_prefix = "tensorflow-",/' WORKSPACE
++ sed -E -i 's|"https://github.com/tensorflow/tensorflow/archive/v.+\.zip"|"https://github.com/tensorflow/tensorflow/archive/.zip"|' WORKSPACE
+++ grep -A 1 -e 'strip_prefix.*tensorflow-' WORKSPACE
+++ tail -1
+++ awk -F '"' '{print $2}'
++ prev_shasum=447cdb65c80c86d6c6cf1388684f157612392723eaea832e6392d219098b49de
++ sed -i 's/sha256 = "447cdb65c80c86d6c6cf1388684f157612392723eaea832e6392d219098b49de",//' WORKSPACE
+ bazel build --enable_runfiles oss_scripts/pip_package:build_pip_package
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'build' from /opt/tensorflow-text/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /opt/tensorflow-text/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils,tensorflow/core/tfrt/utils/debug --action_env TF_HEADER_DIR=/usr/local/lib/python3.10/dist-packages/tensorflow/include --action_env TF_SHARED_LIBRARY_DIR=/usr/local/lib/python3.10/dist-packages/tensorflow --action_env TF_SHARED_LIBRARY_NAME=libtensorflow_framework.so.2 --action_env TF_CXX11_ABI_FLAG=1
INFO: Found applicable config definition build:short_logs in file /opt/tensorflow-text/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /opt/tensorflow-text/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:linux in file /opt/tensorflow-text/.bazelrc: --define=build_with_onednn_v2=true --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /opt/tensorflow-text/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
Loading: 
Loading: 0 packages loaded
INFO: Repository org_tensorflow instantiated at:
  /opt/tensorflow-text/WORKSPACE:71:13: in <toplevel>
Repository rule http_archive defined at:
  /root/.cache/bazel/_bazel_root/85e1e75b08f730f1cb0a39e292604ff5/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31: in <toplevel>
WARNING: Download from https://github.com/tensorflow/tensorflow/archive/.zip failed: class java.io.FileNotFoundException GET returned 404 Not Found
ERROR: An error occurred during the fetch of repository 'org_tensorflow':
   Traceback (most recent call last):
	File "/root/.cache/bazel/_bazel_root/85e1e75b08f730f1cb0a39e292604ff5/external/bazel_tools/tools/build_defs/repo/http.bzl", line 125, column 45, in _http_archive_impl
		download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/tensorflow/tensorflow/archive/.zip] to /root/.cache/bazel/_bazel_root/85e1e75b08f730f1cb0a39e292604ff5/external/org_tensorflow/temp689896470524611324/.zip: GET returned 404 Not Found
ERROR: /opt/tensorflow-text/WORKSPACE:71:13: fetching http_archive rule //external:org_tensorflow: Traceback (most recent call last):
	File "/root/.cache/bazel/_bazel_root/85e1e75b08f730f1cb0a39e292604ff5/external/bazel_tools/tools/build_defs/repo/http.bzl", line 125, column 45, in _http_archive_impl
		download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/tensorflow/tensorflow/archive/.zip] to /root/.cache/bazel/_bazel_root/85e1e75b08f730f1cb0a39e292604ff5/external/org_tensorflow/temp689896470524611324/.zip: GET returned 404 Not Found
ERROR: no such package '@org_tensorflow//tensorflow': java.io.IOException: Error downloading [https://github.com/tensorflow/tensorflow/archive/.zip] to /root/.cache/bazel/_bazel_root/85e1e75b08f730f1cb0a39e292604ff5/external/org_tensorflow/temp689896470524611324/.zip: GET returned 404 Not Found
INFO: Elapsed time: 1.254s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
```
