mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-05 15:15:44 +02:00
Merge pull request #876 from SAP/mail-culprits
mailSendNotification: Avoid full merge trace being added to culprits
This commit is contained in:
commit
37ec5d4a1f
@ -58,10 +58,10 @@ user3@domain.com noreply+github@domain.com'''
|
||||
|
||||
@Test
|
||||
void testCulpritsFromGitCommit() throws Exception {
|
||||
def gitCommand = "git log -2 --pretty=format:'%ae %ce'"
|
||||
def gitCommand = "git log -2 --first-parent --pretty=format:'%ae %ce'"
|
||||
def expected = "user2@domain.com user3@domain.com"
|
||||
|
||||
shellRule.setReturnValue("git log -2 --pretty=format:'%ae %ce'", 'user2@domain.com user3@domain.com')
|
||||
shellRule.setReturnValue("git log -2 --first-parent --pretty=format:'%ae %ce'", 'user2@domain.com user3@domain.com')
|
||||
|
||||
def result = stepRule.step.getCulprits(
|
||||
[
|
||||
|
@ -223,7 +223,7 @@ def getCulprits(config, branch, numberOfCommits) {
|
||||
}
|
||||
}
|
||||
|
||||
def recipients = sh(returnStdout: true, script: "git log -${numberOfCommits} --pretty=format:'%ae %ce'")
|
||||
def recipients = sh(returnStdout: true, script: "git log -${numberOfCommits} --first-parent --pretty=format:'%ae %ce'")
|
||||
return getDistinctRecipients(recipients)
|
||||
} catch(err) {
|
||||
echo "[${STEP_NAME}] Culprit retrieval from git failed with '${err.getMessage()}'. Please make sure to configure gitSshKeyCredentialsId. So far, only fixed list of recipients is used."
|
||||
|
Loading…
x
Reference in New Issue
Block a user