Comparing version 2.11.6 to 2.11.7
@@ -31,3 +31,3 @@ var fs = require('fs'); | ||
git_commit = process.env.DRONE_COMMIT; | ||
git_branch = process.env.DRONE_BRANCH; | ||
git_branch = process.env.DRONE_BRANCH; | ||
} | ||
@@ -67,5 +67,13 @@ */ | ||
git_commit = process.env.WERCKER_GIT_COMMIT; | ||
git_branch = process.env.WERCKER_GIT_BRANCH; | ||
git_branch = process.env.WERCKER_GIT_BRANCH; | ||
} | ||
if (process.env.GITLAB_CI){ | ||
options.service_name = 'gitlab-ci'; | ||
options.service_job_number = process.env.CI_BUILD_NAME; | ||
options.service_job_id = process.env.CI_BUILD_ID; | ||
git_commit = process.env.CI_BUILD_REF; | ||
git_branch = process.env.CI_BUILD_REF_NAME; | ||
} | ||
options.run_at = process.env.COVERALLS_RUN_AT || JSON.stringify(new Date()).slice(1, -1); | ||
@@ -136,3 +144,3 @@ if (process.env.COVERALLS_SERVICE_NAME){ | ||
var firstNonOptionArgument = index.options._[0]; | ||
if (firstNonOptionArgument) | ||
@@ -139,0 +147,0 @@ options.filepath = firstNonOptionArgument; |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "2.11.6", | ||
"version": "2.11.7", | ||
"bugs": { | ||
@@ -11,0 +11,0 @@ "url": "https://github.com/nickmerwin/node-coveralls/issues" |
@@ -141,2 +141,5 @@ var should = require('should'); | ||
}); | ||
it ("should set service_name and service_job_id if it's running on Gitlab", function(done){ | ||
testGitlab(getOptions, done); | ||
}); | ||
it ("should override set options with user options", function(done){ | ||
@@ -386,2 +389,24 @@ var userOptions = {service_name: 'OVERRIDDEN_SERVICE_NAME'}; | ||
var testGitlab = function(sut, done) { | ||
process.env.GITLAB_CI = true; | ||
process.env.CI_BUILD_NAME = 'spec:one'; | ||
process.env.CI_BUILD_ID = "1234"; | ||
process.env.CI_BUILD_REF = "e3e3e3e3e3e3e3e3e"; | ||
process.env.CI_BUILD_REF_NAME = "feature"; | ||
sut(function(err, options){ | ||
options.service_name.should.equal("gitlab-ci"); | ||
options.service_job_id.should.equal("1234"); | ||
options.git.should.eql({ head: | ||
{ id: 'e3e3e3e3e3e3e3e3e', | ||
author_name: 'Unknown Author', | ||
author_email: '', | ||
committer_name: 'Unknown Committer', | ||
committer_email: '', | ||
message: 'Unknown Commit Message' }, | ||
branch: 'feature', | ||
remotes: [] }); | ||
done(); | ||
}); | ||
}; | ||
function ensureLocalGitContext(options) { | ||
@@ -388,0 +413,0 @@ var path = require('path'); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
61718
1480
116