Skip to content

Commit e815a7f

Browse files
Fail CI if the pull request description hasn't been edited (#473)
1 parent c9ff037 commit e815a7f

File tree

1 file changed

+8
-1
lines changed
  • utilities/project-fields-validator

1 file changed

+8
-1
lines changed

utilities/project-fields-validator/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def clean_env_var(var: str) -> str:
478478
return var.strip().strip("\"'")
479479

480480

481-
def main() -> None: # noqa: C901, PLR0915
481+
def main() -> None: # noqa: C901, PLR0915, PLR0912
482482
"""Project Field Validator."""
483483
try:
484484
env_vars = {
@@ -523,6 +523,7 @@ def main() -> None: # noqa: C901, PLR0915
523523
pr_details = validator.get_pr_details(org_name, repo_name, pr_number)
524524
author = pr_details["author"]["login"]
525525
assignees = [node["login"] for node in pr_details["assignees"]["nodes"]]
526+
body = pr_details["body"]
526527

527528
if not assignees:
528529
print(f"\nAssigning PR to author @{author}")
@@ -554,6 +555,12 @@ def main() -> None: # noqa: C901, PLR0915
554555
if validation_errors:
555556
sys.exit(1)
556557

558+
if body.startswith(
559+
"# Description\r\n\r\nThanks for contributing to the project!\r\nPlease fill out this template"
560+
):
561+
print("❌ Please edit the pull request description.")
562+
sys.exit(1)
563+
557564
except GitHubAPIError as e:
558565
print(f"\nError accessing GitHub API: {e!s}")
559566
if e.response_data:

0 commit comments

Comments
 (0)