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 22import time
33import argparse
44import os
5- import requests
65
76
87def create_jwt (private_key , app_id ):
@@ -36,23 +35,7 @@ def create_jwt(private_key, app_id):
3635 print (f"JWT set as environment variable: JWT={ encoded_jwt } " )
3736 return encoded_jwt
3837
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 ()
4938
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 )
5639def main ():
5740 """
5841 to test the code
@@ -68,7 +51,6 @@ def main():
6851
6952 # function call
7053 create_jwt (private_key , app_id )
71- make_github_api_request ()
7254
7355if __name__ == "__main__" :
7456 main ()
You can’t perform that action at this time.
0 commit comments