From 154e01197623efdc07931931f5542e35956a3252 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Wed, 9 Oct 2024 11:20:08 +0100 Subject: [PATCH] chore: add validation for PR description and checklist --- .github/scripts/validate_pr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/validate_pr.py b/.github/scripts/validate_pr.py index 65462caab1..10959c7fe0 100644 --- a/.github/scripts/validate_pr.py +++ b/.github/scripts/validate_pr.py @@ -37,9 +37,9 @@ sys.exit(1) # Check if the first two checklist items are selected -# This pattern allows for optional spaces and both lowercase/uppercase x between brackets -contrib_checked = re.search(r"- \[\s*[xX]\s*\] I have read the \[`CONTRIBUTING`\]\(https://github.com/nginx/agent/blob/main/docs/CONTRIBUTING\.md\)", pr_body) -install_checked = re.search(r"- \[\s*[xX]\s*\] I have run `make install-tools`", pr_body) +# Use simpler patterns: "I have read" and "I have run" +contrib_checked = re.search(r"- \[\s*[xX]\s*\] I have read", pr_body) +install_checked = re.search(r"- \[\s*[xX]\s*\] I have run", pr_body) if not contrib_checked: print("Error: The first checklist item is not checked.")