Skip to content

Commit

Permalink
Fix get_user_description in case pr_description.enable_pr_type=false
Browse files Browse the repository at this point in the history
Fixes an issue when getting the user description after a PR-Agent description was already generated, in case the configuration setting `pr_description.enable_pr_type` was `false`.
  • Loading branch information
zmeir authored Nov 13, 2023
1 parent c5f9bbb commit 7d89b82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pr_agent/git_providers/git_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_pr_description(self, *, full: bool = True) -> str:
def get_user_description(self) -> str:
description = (self.get_pr_description_full() or "").strip()
# if the existing description wasn't generated by the pr-agent, just return it as-is
if not description.startswith("## PR Type"):
if not any(description.startswith(header) for header in ("## PR Type", "## PR Description")):
return description
# if the existing description was generated by the pr-agent, but it doesn't contain the user description,
# return nothing (empty string) because it means there is no user description
Expand Down

0 comments on commit 7d89b82

Please sign in to comment.