Skip to content

Commit eaf443b

Browse files
authored
Merge pull request #8 from devrev/update-workflow-sai/regex
Update regex to handle markdown
2 parents 1aee103 + f045f1e commit eaf443b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

checks/check_pr_description.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ def check_description(description):
66
Checks if the PR description contains a work item link.
77
Returns True if valid, False otherwise.
88
"""
9-
regex = r"(^|\s)(https:\/\/app\.devrev\.ai\/devrev\/works\/)?(ISS|TKT|TASK)-\d+\b"
10-
return bool(re.search(regex, description))
9+
regex = r"(^|\s|\[)(https:\/\/app\.devrev\.ai\/devrev\/works\/)?(ISS|TKT|TASK)-\d+\b"
10+
return bool(re.search(regex, description, re.IGNORECASE))
1111

1212
def check_description_cli(description):
1313
"""
1414
CLI version that prints messages and exits.
1515
"""
1616
print(f"Checking PR description: {description}")
1717
if not check_description(description):
18-
print("PR description must include a link to the work item (e.g., ISS-123, TKT-456, TASK-789, or a full https://app.devrev.ai/devrev/works/ISS-123 link).")
18+
print("PR description must include a link to the work item (e.g., ISS-123, iss-123, TKT-456, tkt-456, TASK-789, task-789, or a full https://app.devrev.ai/devrev/works/ISS-123 link).")
19+
print("Note: If using formats like 'work-item:ISS-123', make sure to add a space after the colon: 'work-item: ISS-123'")
1920
sys.exit(1)
2021
print("PR description contains a valid work item link.")
2122
sys.exit(0)

0 commit comments

Comments
 (0)