Merge pull request #35947 from ClickHouse/template-headers

Highlight headers in PR template
This commit is contained in:
Mikhail f. Shiryaev 2022-04-05 10:32:21 +02:00 committed by GitHub
commit dd8671f361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -1,4 +1,4 @@
Changelog category (leave one):
### Changelog category (leave one):
- New Feature
- Improvement
- Bug Fix (user-visible misbehaviour in official stable or prestable release)
@ -9,7 +9,7 @@ Changelog category (leave one):
- Not for changelog (changelog entry is not required)
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
### Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
...

View File

@ -162,7 +162,7 @@ def check_pr_description(pr_info):
i = 0
while i < len(lines):
if re.match(r"(?i)^[>*_ ]*change\s*log\s*category", lines[i]):
if re.match(r"(?i)^[#>*_ ]*change\s*log\s*category", lines[i]):
i += 1
if i >= len(lines):
break
@ -191,7 +191,7 @@ def check_pr_description(pr_info):
return result_status[:140], category
elif re.match(
r"(?i)^[>*_ ]*(short\s*description|change\s*log\s*entry)", lines[i]
r"(?i)^[#>*_ ]*(short\s*description|change\s*log\s*entry)", lines[i]
):
i += 1
# Can have one empty line between header and the entry itself.
@ -262,9 +262,14 @@ if __name__ == "__main__":
remove_labels(gh, pr_info, pr_labels_to_remove)
if description_report:
print("::notice ::Cannot run, description does not match the template")
print(
"::error ::Cannot run, PR description does not match the template: "
f"{description_report}"
)
logging.info(
"PR body doesn't match the template: (start)\n%s\n(end)", pr_info.body
"PR body doesn't match the template: (start)\n%s\n(end)\n" "Reason: %s",
pr_info.body,
description_report,
)
url = (
f"{GITHUB_SERVER_URL}/{GITHUB_REPOSITORY}/"