Skip to content

Commit

Permalink
Fix commit message check string for Travis CI (#220)
Browse files Browse the repository at this point in the history
* Fix No-Issue label not recognized in commit message.
* Fix `get_commit_message()` returned commit message with
  patch. Now returns only a commit message.

No-Issue
  • Loading branch information
cutwater authored Jun 3, 2020
1 parent 25049b2 commit 4cf42fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis/custom_check_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def git_list_commits(commit_range):


def git_commit_message(commit_sha):
cmd = ["git", "show", "--format=%B", commit_sha]
cmd = ["git", "show", "-s", "--format=%B", commit_sha]
result = subprocess.run(cmd, stdout=subprocess.PIPE, encoding="utf-8", check=True)
return result.stdout

Expand Down Expand Up @@ -76,7 +76,7 @@ def check_commit(commit_sha, repo_slug):
commit_message = git_commit_message(commit_sha)
issue_labels = ISSUE_LABEL_REGEX.findall(commit_message)
if not issue_labels:
no_issue_match = NO_ISSUE_REGEX.match(commit_message)
no_issue_match = NO_ISSUE_REGEX.search(commit_message)
if not no_issue_match:
LOG.error(f"Commit {commit_sha[:8]} has no issue attached")
return False
Expand Down

0 comments on commit 4cf42fe

Please sign in to comment.