@@ -37,12 +37,14 @@ def add_script(category, name, path, entry, arguments, requirments_path, contrib
3737 # <----- Github Login & Database Update ----->
3838 git = Github (pa_token )
3939 user_object = git .get_user ()
40- git_username = user_object .login
4140 print ("[+] PyGithub Login Success!" )
41+
4242 repo = git .get_repo ("avinashkranjan/Amazing-Python-Scripts" )
43- datastore_file = repo .get_contents ("./Master Script/datastore.json" )
44- repo .update_file (datastore_file .path , "Updated datastore.json" , data_store , datastore_file .sha , branch = "main" )
45- repo .update_file ("./datastore.json" , "Updated datastore.json" , data_store , datastore_file .sha , branch = "gh-pages" )
43+ datastore_fileMaster = repo .get_contents ("./Master Script/datastore.json" , ref = "master" )
44+ datastore_fileWebsite = repo .get_contents ("./datastore.json" , ref = "gh-pages" )
45+
46+ repo .update_file (datastore_fileMaster .path , "Updated datastore.json" , data_store , datastore_fileMaster .sha , branch = "master" )
47+ repo .update_file ("./datastore.json" , "Updated datastore.json" , data_store , datastore_fileWebsite .sha , branch = "gh-pages" )
4648 print ("[+] Database Updated" )
4749
4850
@@ -114,4 +116,4 @@ def extract_from_pr_body(pr_body, pa_token):
114116if __name__ == "__main__" :
115117 # Get PR body and pass pa_token
116118 data = sys .argv [1 ]
117- extract_from_pr_body (data , sys .argv [2 ])
119+ extract_from_pr_body (data , sys .argv [2 ])
0 commit comments