From b010d3dd584146e9df2a25ea60b8794978abd1c6 Mon Sep 17 00:00:00 2001 From: Chris Midgley Date: Thu, 19 Mar 2020 17:37:56 +0000 Subject: 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. --- lib/convertLcovToCoveralls.js | 11 +++++------ lib/getOptions.js | 4 ++++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'lib') 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; } -- cgit v1.2.3