Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not ignore case on WIP #942

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions templates/github/.ci/scripts/validate_commit_message.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ BLOCKING_REGEX = [
r"^DO\s*NOT\s*MERGE",
r"^EXPERIMENT",
r"^FIXUP",
r"Apply suggestions from code review",
r"^fixup!", # This is created by 'git commit --fixup'
r"Apply suggestions from code review", # This usually comes from GitHub
]
try:
CHANGELOG_EXTS = [
Expand All @@ -35,7 +36,11 @@ message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).de
if NOISSUE_MARKER in message:
sys.exit(f"Do not add '{NOISSUE_MARKER}' in the commit message.")

if any((re.match(pattern, message, re.IGNORECASE) for pattern in BLOCKING_REGEX)):
blocking_matches = [m for m in (re.match(pattern, message) for pattern in BLOCKING_REGEX) if m]
if blocking_matches:
print("Found these phrases in the commit message:")
for m in blocking_matches:
print(" - " + m.group(0))
sys.exit("This PR is not ready for consumption.")

g = Github(os.environ.get("GITHUB_TOKEN"))
Expand Down
Loading