Skip to content

Commit

Permalink
Enhance TemplateManager initialization: update parameters for proper …
Browse files Browse the repository at this point in the history
…instantiation and streamline pull request details rendering
  • Loading branch information
Your Name committed May 13, 2025
1 parent 5a8d0d1 commit f4d1e4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions template-automation-lambda.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
{
"name": "r",
"path": "../providers/terraform-provider-aws/website/docs/r"
},
{
"path": "../PyGithub"
}
],
"settings": {}
Expand Down
16 changes: 8 additions & 8 deletions template_automation/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def lambda_handler(event: dict, context) -> dict:
commit_author_email=github_config.commit_author_email,
verify_ssl=VERIFY_SSL # Pass SSL verification setting
)
template_mgr = TemplateManager(github_config)

# Initialize TemplateManager with proper parameters
template_mgr = TemplateManager(template_repo_name=github_config.template_repo_name)

# Create repository from template
repo_name = template_input.project_name
Expand All @@ -176,17 +178,15 @@ def lambda_handler(event: dict, context) -> dict:
github.update_repository_topics(repo_name, DEFAULT_TOPICS)

# Create pull request with template configuration
config = template_mgr.get_pr_config()
pr_title = config.title_template.format(repo_name=repo_name)
pr_body = config.body_template.format(
pr_details = template_mgr.render_pr_details(
repo_name=repo_name,
template_repo=github_config.template_repo_name
workflow_files=[DEFAULT_CONFIG_FILE]
)

pr = github.create_pull_request(
repo_name=repo_name,
title=pr_title,
body=pr_body,
title=pr_details["title"],
body=pr_details["body"],
head_branch=feature_branch,
base_branch=github.get_default_branch(repo_name)
)
Expand Down

0 comments on commit f4d1e4b

Please sign in to comment.