File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change 2
2
import time
3
3
import argparse
4
4
import os
5
- import requests
6
5
7
6
8
7
def create_jwt (private_key , app_id ):
@@ -36,23 +35,7 @@ def create_jwt(private_key, app_id):
36
35
print (f"JWT set as environment variable: JWT={ encoded_jwt } " )
37
36
return encoded_jwt
38
37
39
- def make_github_api_request ():
40
- url = " https://api.github.com/app"
41
- headers = {
42
- "Accept" : "application/vnd.github+json" ,
43
- "Authorization" : f"Bearer { os .getenv ('GITHUB_JWT' )} " ,
44
- "X-GitHub-Api-Version" : "2022-11-28"
45
- }
46
-
47
- response = requests .get (url , headers = headers )
48
- response_json = response .json ()
49
38
50
- if response .status_code == 200 :
51
- print ("API request successful:" )
52
- print (response_json )
53
- else :
54
- print (f"API request failed with status code { response .status_code } :" )
55
- print (response_json )
56
39
def main ():
57
40
"""
58
41
to test the code
@@ -68,7 +51,6 @@ def main():
68
51
69
52
# function call
70
53
create_jwt (private_key , app_id )
71
- make_github_api_request ()
72
54
73
55
if __name__ == "__main__" :
74
56
main ()
You can’t perform that action at this time.
0 commit comments