Skip to content

Commit 58dbf86

Browse files
authored
When downloading external projects, provide GitHub token if available (#717)
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 4f1d245 commit 58dbf86

13 files changed

+22
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ git clone https://github.com/firebase/firebase-cpp-sdk.git
5151
The following prerequisites are required for all platforms. Be sure to add any
5252
directories to your PATH as needed.
5353

54-
- [CMake](https://cmake.org/), version 3.1, or newer
54+
- [CMake](https://cmake.org/), version 3.7, or newer
5555
- [Python](https://www.python.com/), version of 3.7, or newer
5656
- [Abseil-py](https://github.com/abseil/abseil-py)
5757

cmake/external/boringssl.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ ExternalProject_Add(
3636
BUILD_COMMAND ""
3737
INSTALL_COMMAND ""
3838
TEST_COMMAND ""
39+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3940
)
4041

cmake/external/curl.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ ExternalProject_Add(
3232
BUILD_COMMAND ""
3333
INSTALL_COMMAND ""
3434
TEST_COMMAND ""
35+
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
3536
)

cmake/external/firebase_ios_sdk.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ set(OUTDIR "./firebase_ios_sdk/")
3939
if(FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS)
4040
if(NOT EXISTS ${OUTDIR})
4141
if(NOT EXISTS ${ZIP_FILENAME})
42-
file(DOWNLOAD ${URL} ${ZIP_FILENAME})
42+
file(DOWNLOAD ${URL} ${ZIP_FILENAME} HTTPHEADER "${EXTERNAL_PROJECT_HTTP_HEADER}")
4343
endif()
4444
execute_process(COMMAND mkdir ${OUTDIR})
4545
execute_process(COMMAND tar -xf ${ZIP_FILENAME} -C ${OUTDIR})

cmake/external/firestore.cmake

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

cmake/external/flatbuffers.cmake

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

cmake/external/googletest.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/leveldb.cmake

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

cmake/external/libuv.cmake

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

cmake/external/nanopb.cmake

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

0 commit comments

Comments
 (0)