Skip to content

Commit

Permalink
fix : support ai title with markers
Browse files Browse the repository at this point in the history
  • Loading branch information
benedict-lee authored Jan 6, 2025
1 parent c889e56 commit 07d40e2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pr_agent/tools/pr_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,16 @@ def _prepare_labels(self) -> List[str]:

def _prepare_pr_answer_with_markers(self) -> Tuple[str, str, str, List[dict]]:
get_logger().info(f"Using description marker replacements {self.pr_id}")
title = self.vars["title"]

# Remove the 'PR Title' key from the dictionary
ai_title = self.data.pop('title', self.vars["title"])
if (not get_settings().pr_description.generate_ai_title):
# Assign the original PR title to the 'title' variable
title = self.vars["title"]
else:
# Assign the value of the 'PR Title' key to 'title' variable
title = ai_title

body = self.user_description
if get_settings().pr_description.include_generated_by_header:
ai_header = f"### 🤖 Generated by PR Agent at {self.git_provider.last_commit_id.sha}\n\n"
Expand Down

0 comments on commit 07d40e2

Please sign in to comment.