@@ -22,23 +22,6 @@ def get_installation_access_token(app_id: int, private_key: str,
22
22
assert auth
23
23
return auth .token
24
24
25
- # TODO: this may not be required
26
- # def create_mongodb_bot_gitconfig():
27
- # """Create the mongodb-bot.gitconfig file with the desired content."""
28
-
29
- # content = """
30
- # [user]
31
- # name = MongoDB Bot
32
-
33
- # """
34
-
35
- # gitconfig_path = os.path.expanduser("~/mongodb-bot.gitconfig")
36
-
37
- # with open(gitconfig_path, 'w') as file:
38
- # file.write(content)
39
-
40
- # print("mongodb-bot.gitconfig file created.")
41
-
42
25
43
26
def main (branch : Annotated [str , typer .Option (envvar = "GITHUB_REF" )],
44
27
app_id : Annotated [int , typer .Option (envvar = "APP_ID" )],
@@ -47,19 +30,15 @@ def main(branch: Annotated[str, typer.Option(envvar="GITHUB_REF")],
47
30
48
31
access_token = get_installation_access_token (app_id , server_docs_private_key , installation_id )
49
32
50
- # Create the mongodb-bot.gitconfig file as necessary.
51
- # TODO: this may not be required
52
- # create_mongodb_bot_gitconfig()
53
-
54
33
git_destination_url_with_token = f"https://x-access-token:{ access_token } @github.com/mongodb/docs.git"
55
34
56
35
# Use a local path for testing
57
36
# git_destination_url_with_token = "path_to_local_git"
58
37
59
38
# Add the destination repo and name it upstream
60
- subprocess .run (["git" , "remote" , "add" , "upstream " , git_destination_url_with_token ], check = True )
39
+ subprocess .run (["git" , "remote" , "add" , "mongodb-docs " , git_destination_url_with_token ], check = True )
61
40
# Push the code upstream
62
- subprocess .run (["git" , "push" , "upstream " , branch ], check = True )
41
+ subprocess .run (["git" , "push" , "mongodb-docs " , branch ], check = True )
63
42
64
43
65
44
if __name__ == "__main__" :
0 commit comments