feat: update branch name generation to sanitize issue title input
Some checks failed
Run Python tests (through Pytest) / Test (push) Failing after 24s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 23s

This commit is contained in:
Jon Michael Aanes (aider) 2025-04-13 16:45:14 +02:00
parent 4e014d4df4
commit 298402ff2b

View File

@ -24,8 +24,8 @@ def generate_branch_name(issue_number: str, issue_title: str) -> str:
Non-alphanumeric characters (except spaces) are removed,
the text is lowercased, and spaces are replaced with dashes.
"""
title_slug = issue_title.lower().replace(" ", "-")
return f"issue-{issue_number}-{title_slug}"
sanitized = re.sub(r"[^0-9a-zA-Z ]+", "", issue_title)
return "issue-" + "-".join(sanitized.lower().split())
logger = logging.getLogger(__name__)