aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Midgley <[email protected]>2020-03-19 17:37:56 +0000
committerGitHub <[email protected]>2020-03-19 10:37:56 -0700
commitb010d3dd584146e9df2a25ea60b8794978abd1c6 (patch)
tree60ce0f1cca4eb9a09beb1fc50f8117f20839dbb9 /lib
parent2ea7be3fc03ffe9553886f738a7f8e5a75a5d5d7 (diff)
downloadnode-coveralls-b010d3dd584146e9df2a25ea60b8794978abd1c6.tar.xz
node-coveralls-b010d3dd584146e9df2a25ea60b8794978abd1c6.zip
If COVERALLS_SERVICE_NUMBER is set, set service_number from it. (#208)
* If COVERALLS_SERVICE_NUMBER is set, set service_number from it. Remove the duplicate service_pull_request set.
Diffstat (limited to 'lib')
-rw-r--r--lib/convertLcovToCoveralls.js11
-rw-r--r--lib/getOptions.js4
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js
index 860dc44..4323034 100644
--- a/lib/convertLcovToCoveralls.js
+++ b/lib/convertLcovToCoveralls.js
@@ -79,7 +79,11 @@ const convertLcovToCoveralls = (input, options, cb) => {
if (options.service_name) {
postJson.service_name = options.service_name;
}
-
+
+ if (options.service_number) {
+ postJson.service_number = options.service_number;
+ }
+
if (options.service_job_id) {
postJson.service_job_id = options.service_job_id;
}
@@ -95,11 +99,6 @@ const convertLcovToCoveralls = (input, options, cb) => {
if (options.parallel) {
postJson.parallel = options.parallel;
}
-
- if (options.service_pull_request) {
- postJson.service_pull_request = options.service_pull_request;
- }
-
parsed.forEach(file => {
file.file = cleanFilePath(file.file);
const currentFilePath = path.resolve(filepath, file.file);
diff --git a/lib/getOptions.js b/lib/getOptions.js
index c4a3e31..c56264c 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -143,6 +143,10 @@ const getBaseOptions = cb => {
options.run_at = process.env.COVERALLS_RUN_AT || JSON.stringify(new Date()).slice(1, -1);
+ if (process.env.COVERALLS_SERVICE_NUMBER) {
+ options.service_number = process.env.COVERALLS_SERVICE_NUMBER;
+ }
+
if (process.env.COVERALLS_SERVICE_JOB_ID) {
options.service_job_id = process.env.COVERALLS_SERVICE_JOB_ID;
}