File tree 3 files changed +19
-3
lines changed
3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 65
65
run : |
66
66
./scripts/1-fetch/github_fetch.py \
67
67
--enable-save --enable-git
68
+ env :
69
+ GH_TOKEN : ${{ secrets.BOT_TOKEN }}
Original file line number Diff line number Diff line change 1
1
# This file must be copied to .env and the appropriate variables populated.
2
2
3
3
4
+ # GitHub
5
+
6
+ # https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-authenticated-users
7
+ #
8
+ # https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
9
+
10
+ # GH_TOKEN =
11
+
12
+
4
13
## GCS (Google Custom Search)
5
14
6
15
# https://developers.google.com/custom-search/v1/introduction
21
30
22
31
# GCS_CX =
23
32
33
+
24
34
## Flickr
35
+
25
36
# "The flickr developer guide: https://www.flickr.com/services/developer/"
26
37
27
38
# FLICKR_API_KEY =
Original file line number Diff line number Diff line change 31
31
32
32
# Constants
33
33
FILE1_COUNT = os .path .join (PATHS ["data_phase" ], "github_1_count.csv" )
34
+ GH_TOKEN = os .getenv ("GH_TOKEN" )
34
35
GITHUB_RETRY_STATUS_FORCELIST = [
35
36
408 , # Request Timeout
36
- 422 , # Unprocessable Content
37
- # (Validation failed, or the endpoint has been spammed)
37
+ 422 , # Unprocessable Content (Validation failed, or endpoint spammed)
38
38
429 , # Too Many Requests
39
39
500 , # Internal Server Error
40
40
502 , # Bad Gateway
@@ -94,7 +94,10 @@ def get_requests_session():
94
94
)
95
95
session = requests .Session ()
96
96
session .mount ("https://" , HTTPAdapter (max_retries = max_retries ))
97
- session .headers .update ({"Accept" : "application/vnd.github+json" })
97
+ headers = {"accept" : "application/vnd.github+json" }
98
+ if GH_TOKEN :
99
+ headers ["authorization" ] = f"Bearer { GH_TOKEN } "
100
+ session .headers .update (headers )
98
101
99
102
return session
100
103
You can’t perform that action at this time.
0 commit comments