File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ import githubapps
3
+ from github import Github
4
+
5
+ # using an access token
6
+
7
+
8
+ def main ():
9
+ with open ('env/private.key' , 'rb' ) as f_private :
10
+ private_key = f_private .read ()
11
+ with open ('env/app_id.key' , 'r' ) as f_app_id :
12
+ app_id = f_app_id .read ()
13
+ with open ('env/installation_id.key' , 'r' ) as f_installation_id :
14
+ installation_id = f_installation_id .read ()
15
+ client_secret = private_key
16
+ auth = githubapps .AiohttpAuth (app_id , installation_id , client_secret )
17
+ access_token = auth .get_access_token ()
18
+
19
+ g = Github (access_token )
20
+ print (access_token )
21
+ if __name__ == "__main__" :
22
+ main ()
Original file line number Diff line number Diff line change
1
+
2
+ import githubapps
3
+ from github import Github
4
+ import asyncio
5
+
6
+ # using an access token
7
+
8
+
9
+ async def main ():
10
+ with open ('env/private.key' , 'rb' ) as f_private :
11
+ private_key = f_private .read ()
12
+ with open ('env/app_id.key' , 'r' ) as f_app_id :
13
+ app_id = f_app_id .read ()
14
+ with open ('env/installation_id.key' , 'r' ) as f_installation_id :
15
+ installation_id = f_installation_id .read ()
16
+ client_secret = private_key
17
+ auth = githubapps .AiohttpAuth (app_id , installation_id , client_secret )
18
+ access_token = await auth .get_access_token ()
19
+
20
+ g = Github (access_token )
21
+ print (access_token )
22
+ if __name__ == "__main__" :
23
+ asyncio .run (main ())
You can’t perform that action at this time.
0 commit comments