@@ -37,12 +37,14 @@ def add_script(category, name, path, entry, arguments, requirments_path, contrib
37
37
# <----- Github Login & Database Update ----->
38
38
git = Github (pa_token )
39
39
user_object = git .get_user ()
40
- git_username = user_object .login
41
40
print ("[+] PyGithub Login Success!" )
41
+
42
42
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" )
46
48
print ("[+] Database Updated" )
47
49
48
50
@@ -114,4 +116,4 @@ def extract_from_pr_body(pr_body, pa_token):
114
116
if __name__ == "__main__" :
115
117
# Get PR body and pass pa_token
116
118
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