Skip to content

Commit c54639f

Browse files
committed
target branch
1 parent 5cf1388 commit c54639f

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

osa_tool/config/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class GitSettings(BaseModel):
3535
host_domain: str | None = None
3636
host: str | None = None
3737
name: str = ""
38+
osa_branch_name: str = "osa_tool"
3839

3940
@model_validator(mode="after")
4041
def set_git_attributes(self):

osa_tool/core/git/git_agent.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ class GitAgent(abc.ABC):
3838
pr_report_body: A formatted message for a pull request.
3939
"""
4040

41-
DEFAULT_BRANCH_NAME = "osa_tool"
42-
43-
def __init__(
44-
self, repo_url: str, repo_branch_name: str = None, branch_name: str = DEFAULT_BRANCH_NAME, author: str = None
45-
):
41+
def __init__(self, repo_url: str, repo_branch_name: str = None, branch_name: str = "osa_tool", author: str = None):
4642
"""Initializes the agent with repository info.
4743
4844
Args:

osa_tool/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def main():
6969
config_manager = ConfigManager(args)
7070

7171
# Initialize Git agent and Workflow Manager for used platform, perform operations
72-
git_agent, workflow_manager = initialize_git_platform(args)
72+
git_agent, workflow_manager = initialize_git_platform(args, config_manager)
7373

7474
if create_fork:
7575
git_agent.star_repository()
@@ -239,11 +239,11 @@ def main():
239239
sys.exit(1)
240240

241241

242-
def initialize_git_platform(args) -> tuple[GitAgent, WorkflowManager]:
242+
def initialize_git_platform(args, config_manager: ConfigManager) -> tuple[GitAgent, WorkflowManager]:
243243
if os.getenv("GITHUB_ACTIONS").lower() == "true":
244244
target_branch = args.branch
245245
else:
246-
target_branch = GitAgent.DEFAULT_BRANCH_NAME
246+
target_branch = config_manager.config.osa_branch_name
247247

248248
if "github.com" in args.repository:
249249
git_agent = GitHubAgent(

0 commit comments

Comments
 (0)