diff --git a/lib/getOptions.js b/lib/getOptions.js index e579eee1..25360670 100644 --- a/lib/getOptions.js +++ b/lib/getOptions.js @@ -9,6 +9,7 @@ var getBaseOptions = function(cb){ var options = {}; var git_commit = process.env.COVERALLS_GIT_COMMIT; var git_branch = process.env.COVERALLS_GIT_BRANCH; + var git_committer_name, git_committer_email, git_message; var match = (process.env.CI_PULL_REQUEST || "").match(/(\d+)$/); @@ -57,6 +58,9 @@ var getBaseOptions = function(cb){ options.service_job_id = process.env.CI_BUILD_NUMBER; git_commit = process.env.CI_COMMIT_ID; git_branch = process.env.CI_BRANCH; + git_committer_name = process.env.CI_COMMITTER_NAME; + git_committer_email = process.env.CI_COMMITTER_EMAIL; + git_message = process.env.CI_COMMIT_MESSAGE; } if (process.env.WERCKER){ @@ -123,7 +127,10 @@ var getBaseOptions = function(cb){ if (git_commit){ fetchGitData({ head: { - id: git_commit + id: git_commit, + committer_name: git_committer_name, + committer_email: git_committer_email, + message: git_message }, branch: git_branch }, function(err, git){ diff --git a/test/getOptions.js b/test/getOptions.js index 3394a854..b82f3652 100644 --- a/test/getOptions.js +++ b/test/getOptions.js @@ -338,6 +338,9 @@ var testCodeship = function(sut, done) { process.env.CI_BUILD_NUMBER = '1234'; process.env.CI_COMMIT_ID = "e3e3e3e3e3e3e3e3e"; process.env.CI_BRANCH = "master"; + process.env.CI_COMMITTER_NAME = "John Doe"; + process.env.CI_COMMITTER_EMAIL = "jd@example.com"; + process.env.CI_COMMIT_MESSAGE = "adadadadadadadadadad"; sut(function(err, options){ options.service_name.should.equal("codeship"); options.service_job_id.should.equal("1234"); @@ -345,9 +348,9 @@ var testCodeship = function(sut, done) { { id: 'e3e3e3e3e3e3e3e3e', author_name: 'Unknown Author', author_email: '', - committer_name: 'Unknown Committer', - committer_email: '', - message: 'Unknown Commit Message' }, + committer_name: 'John Doe', + committer_email: 'jd@example.com', + message: 'adadadadadadadadadad' }, branch: 'master', remotes: [] }); done();