Return the Trac ticket ID string from the PR body, or None.
(pr_body)
| 172 | |
| 173 | |
| 174 | def extract_ticket_id(pr_body): |
| 175 | """Return the Trac ticket ID string from the PR body, or None.""" |
| 176 | match = re.search(r"\bticket-(\d+)\b", pr_body, re.IGNORECASE) |
| 177 | return match.group(1) if match else None |
| 178 | |
| 179 | |
| 180 | def fetch_trac_ticket(ticket_id): |