Insert issue comment from commit message as 'commit' action.

This commit is contained in:
takezoe
2013-07-08 15:33:53 +09:00
parent 97101248a2
commit f13e2c0d71

View File

@@ -85,7 +85,7 @@ class CommitLogHook(owner: String, repository: String, userName: String) extends
"(^|\\W)#(\\d+)(\\W|$)".r.findAllIn(commit.fullMessage).matchData.foreach { matchData => "(^|\\W)#(\\d+)(\\W|$)".r.findAllIn(commit.fullMessage).matchData.foreach { matchData =>
val issueId = matchData.group(2) val issueId = matchData.group(2)
if(getAccountByUserName(commit.committer).isDefined && getIssue(owner, repository, issueId).isDefined){ if(getAccountByUserName(commit.committer).isDefined && getIssue(owner, repository, issueId).isDefined){
createComment(owner, repository, commit.committer, issueId.toInt, commit.fullMessage, None) createComment(owner, repository, commit.committer, issueId.toInt, commit.fullMessage, Some("commit"))
} }
} }
Some(commit) Some(commit)