Skip to content

Commit

Permalink
chore: add validation for PR description and checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
oCHRISo committed Oct 9, 2024
1 parent fc62bdd commit 154e011
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/validate_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 154e011

Please sign in to comment.