Add options to keep original user title

This commit is contained in:
zmeir
2023-08-22 10:32:58 +03:00
parent 09ef809080
commit 82fb611a26
2 changed files with 9 additions and 2 deletions

View File

@ -25,6 +25,7 @@ extra_instructions = ""
[pr_description] # /describe #
publish_description_as_comment=false
add_original_user_description=false
keep_original_user_title=false
extra_instructions = ""
[pr_questions] # /ask #

View File

@ -166,8 +166,14 @@ class PRDescription:
elif type(data['PR Type']) == str:
pr_types = data['PR Type'].split(',')
# Assign the value of the 'PR Title' key to 'title' variable and remove it from the dictionary
title = data.pop('PR Title')
# Remove the 'PR Title' key from the dictionary
ai_title = data.pop('PR Title')
if get_settings().pr_description.keep_original_user_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
# Iterate over the remaining dictionary items and append the key and value to 'pr_body' in a markdown format,
# except for the items containing the word 'walkthrough'