Skip to content

Commit

Permalink
Skip commit message check for backports (#1697) (#1704)
Browse files Browse the repository at this point in the history
(cherry picked from commit ea2b0ee)

Co-authored-by: Ryan Julian <ryanjulian@users.noreply.github.com>
  • Loading branch information
mergify[bot] and ryanjulian committed Jul 3, 2020
1 parent 8f14d97 commit 3965a2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/check_commit_message
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
"""Checks that a commit message conforms the the style guide."""
import sys

# Get the commit message location
Expand All @@ -10,6 +11,10 @@ lines = list((line.rstrip() for line in open(commit_msg_filepath, 'r')))
# Remove all commented lines
lines = [line for line in lines if len(line) == 0 or line[0] != '#']

# Skip if this is an automated backport
if len(lines) >= 2 and 'cherry picked from commit' in lines[-2]:
sys.exit(0)

exit_code = 0

# Error: no commit message
Expand Down

0 comments on commit 3965a2e

Please sign in to comment.