Skip to content

Commit 76e2cd7

Browse files
authored
When downloading external projects, provide a GitHub token if there is one. (#8899)
When downloading external projects, if the GITHUB_TOKEN environment variable is set, pass it to the external download cmake function via HTTP_HEADER. This will prevent GitHub throttling the HTTP requests. Unauthenticated requests are limited by GitHub to 60 per IP address per hour, whereas authenticated requests are limited to 5,000 per user per hour. (GitHub Actions runners automatically have the GITHUB_TOKEN environment variable set.)
1 parent e336955 commit 76e2cd7

12 files changed

+24
-0
lines changed

cmake/external/GoogleUtilities.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ ExternalProject_Add(
3030
BUILD_COMMAND ""
3131
INSTALL_COMMAND ""
3232
TEST_COMMAND ""
33+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3334
)

cmake/external/abseil-cpp.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ ExternalProject_Add(
3030
BUILD_COMMAND ""
3131
INSTALL_COMMAND ""
3232
TEST_COMMAND ""
33+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3334
)

cmake/external/benchmark.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ ExternalProject_Add(
3434
BUILD_COMMAND ""
3535
INSTALL_COMMAND ""
3636
TEST_COMMAND ""
37+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3738
)

cmake/external/boringssl.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ ExternalProject_Add(
3737
BUILD_COMMAND ""
3838
INSTALL_COMMAND ""
3939
TEST_COMMAND ""
40+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
4041
)

cmake/external/c-ares.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ ExternalProject_Add(
3737
BUILD_COMMAND ""
3838
INSTALL_COMMAND ""
3939
TEST_COMMAND ""
40+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
4041
)

cmake/external/googletest.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ ExternalProject_Add(
3434
BUILD_COMMAND ""
3535
INSTALL_COMMAND ""
3636
TEST_COMMAND ""
37+
38+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3739
)

cmake/external/grpc.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ ExternalProject_Add(
3535
BUILD_COMMAND ""
3636
TEST_COMMAND ""
3737
INSTALL_COMMAND ""
38+
39+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3840
)

cmake/external/leveldb.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ ExternalProject_Add(
3434
BUILD_COMMAND ""
3535
INSTALL_COMMAND ""
3636
TEST_COMMAND ""
37+
38+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3739
)

cmake/external/nanopb.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ ExternalProject_Add(
3434
BUILD_COMMAND ""
3535
INSTALL_COMMAND ""
3636
TEST_COMMAND ""
37+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3738
)

cmake/external/protobuf.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ ExternalProject_Add(
3737
BUILD_COMMAND ""
3838
INSTALL_COMMAND ""
3939
TEST_COMMAND ""
40+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
4041
)

0 commit comments

Comments
 (0)