github: Include old issue number in transfer message for new repo.

This commit updates the GitHub webhook integration to include the
old issue number in the transfer message sent for the new repository,
alongside the old repository's full name.
This commit is contained in:
Aditya Kumar Kasaudhan
2025-02-27 13:33:41 +05:30
committed by Tim Abbott
parent f9107adaa4
commit 18d83534ff
2 changed files with 4 additions and 2 deletions

View File

@@ -703,12 +703,14 @@ def get_issue_transferred_body(helper: Helper) -> str:
def get_issue_opened_via_transfer_body(helper: Helper) -> str:
payload = helper.payload
template = "[Issue #{new_issue_number} {title}]({new_issue_url}) was transferred from {old_repo_full_name}."
template = "[Issue #{new_issue_number} {title}]({new_issue_url}) was transferred from [{old_repo_full_name}#{old_issue_number}]({old_issue_url})."
return template.format(
new_issue_number=payload["issue"]["number"].tame(check_int),
new_issue_url=payload["issue"]["html_url"].tame(check_string),
title=payload["issue"]["title"].tame(check_string),
old_repo_full_name=payload["changes"]["old_repository"]["full_name"].tame(check_string),
old_issue_number=payload["changes"]["old_issue"]["number"].tame(check_int),
old_issue_url=payload["changes"]["old_issue"]["html_url"].tame(check_string),
)