From 3965a2e173232e5475a3c2ca4c128eada14e2556 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 3 Jul 2020 18:50:50 +0000 Subject: [PATCH] Skip commit message check for backports (#1697) (#1704) (cherry picked from commit ea2b0eeeb8ad25a76b9a2fca8a00fe0bf8b25137) Co-authored-by: Ryan Julian --- scripts/check_commit_message | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/check_commit_message b/scripts/check_commit_message index 09d7a849fc..dddc57b641 100755 --- a/scripts/check_commit_message +++ b/scripts/check_commit_message @@ -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 @@ -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