Skip to content

Commit 7b93975

Browse files
committed
Another shot
1 parent f5b4b01 commit 7b93975

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

repo_sync.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,6 @@ def get_installation_access_token(app_id: int, private_key: str,
2222
assert auth
2323
return auth.token
2424

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-
4225

4326
def main(branch: Annotated[str, typer.Option(envvar="GITHUB_REF")],
4427
app_id: Annotated[int, typer.Option(envvar="APP_ID")],
@@ -47,19 +30,15 @@ def main(branch: Annotated[str, typer.Option(envvar="GITHUB_REF")],
4730

4831
access_token = get_installation_access_token(app_id, server_docs_private_key, installation_id)
4932

50-
# Create the mongodb-bot.gitconfig file as necessary.
51-
# TODO: this may not be required
52-
# create_mongodb_bot_gitconfig()
53-
5433
git_destination_url_with_token = f"https://x-access-token:{access_token}@github.com/mongodb/docs.git"
5534

5635
# Use a local path for testing
5736
# git_destination_url_with_token = "path_to_local_git"
5837

5938
# 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)
6140
# Push the code upstream
62-
subprocess.run(["git", "push", "upstream", branch], check=True)
41+
subprocess.run(["git", "push", "mongodb-docs", branch], check=True)
6342

6443

6544
if __name__ == "__main__":

0 commit comments

Comments
 (0)