8
8
9
9
orgs = ["jupyter" , 'ipython' , 'jupyterhub' , 'jupyterlab' ]
10
10
token = os .getenv ("GH_TOKEN" )
11
+ headers = {
12
+ 'Authorization' : f'token { token } ' ,
13
+ 'Accept' : 'application/vnd.github.v3+json'
14
+ }
11
15
12
16
async def check_private_vulnerability_reporting (session , org , repo_name ):
13
- headers = {
14
- 'Authorization' : f'token { token } ' ,
15
- 'Accept' : 'application/vnd.github.v3+json'
16
- }
17
17
url = f'https://api.github.com/repos/{ org } /{ repo_name } /private-vulnerability-reporting'
18
18
19
19
async with session .get (url , headers = headers ) as response :
@@ -23,11 +23,6 @@ async def check_private_vulnerability_reporting(session, org, repo_name):
23
23
return False
24
24
25
25
async def get_org_repos (session , org ):
26
- headers = {
27
- 'Authorization' : f'token { token } ' ,
28
- 'Accept' : 'application/vnd.github.v3+json'
29
- }
30
-
31
26
repos = []
32
27
page = 1
33
28
while True :
@@ -49,10 +44,6 @@ async def get_org_repos(session, org):
49
44
async def main ():
50
45
async with aiohttp .ClientSession () as session :
51
46
# Check rate limit before making requests
52
- headers = {
53
- 'Authorization' : f'token { token } ' ,
54
- 'Accept' : 'application/vnd.github.v3+json'
55
- }
56
47
async with session .get ('https://api.github.com/rate_limit' , headers = headers ) as response :
57
48
if response .status == 200 :
58
49
rate_data = await response .json ()
0 commit comments