diff --git a/updatebot.py b/updatebot.py index 62e94b5..2aaddfb 100644 --- a/updatebot.py +++ b/updatebot.py @@ -158,6 +158,7 @@ Project = Union[ class RepoConfig(pydantic.BaseModel): url: str token_file: Path + branch: str = 'master' @functools.cached_property def repo_api_url(self) -> str: @@ -300,7 +301,7 @@ def main() -> None: d = Path(d) log.debug('Retreiving repository Git URL') repo_url = config.repo.get_git_url() - repo = git.Repo.clone_from(repo_url, d, depth=1) + repo = git.Repo.clone_from(repo_url, d, depth=1, b=config.repo.branch) log.debug('Checking out new branch: %s', args.branch_name) repo.heads[0].checkout(force=True, B=args.branch_name) title = None @@ -321,7 +322,7 @@ def main() -> None: ) ) repo.remote().push(force=True) - config.repo.create_pr(title, args.branch_name, 'master') + config.repo.create_pr(title, args.branch_name, config.repo.branch) if __name__ == '__main__':