diff --git a/lib/getOptions.js b/lib/getOptions.js index 3ac55794..3b36a97d 100644 --- a/lib/getOptions.js +++ b/lib/getOptions.js @@ -120,9 +120,10 @@ const getBaseOptions = cb => { if (process.env.SEMAPHORE) { options.service_name = 'semaphore'; - options.service_job_id = process.env.SEMAPHORE_BUILD_NUMBER; - git_commit = process.env.REVISION; - git_branch = process.env.BRANCH_NAME; + options.service_job_id = process.env.SEMAPHORE_WORKFLOW_ID; + options.service_pull_request = process.env.SEMAPHORE_GIT_PR_NUMBER; + git_commit = process.env.SEMAPHORE_GIT_SHA; + git_branch = process.env.SEMAPHORE_GIT_WORKING_BRANCH; } if (process.env.TF_BUILD) { diff --git a/test/getOptions.js b/test/getOptions.js index 5bf0312f..5d4ff8db 100644 --- a/test/getOptions.js +++ b/test/getOptions.js @@ -657,9 +657,10 @@ const testBuildkite = (sut, done) => { const testSemaphore = (sut, done) => { process.env.SEMAPHORE = true; - process.env.SEMAPHORE_BUILD_NUMBER = '1234'; - process.env.REVISION = 'e3e3e3e3e3e3e3e3e'; - process.env.BRANCH_NAME = 'master'; + process.env.SEMAPHORE_WORKFLOW_ID = '1234'; + process.env.SEMAPHORE_GIT_SHA = 'e3e3e3e3e3e3e3e3e'; + process.env.SEMAPHORE_GIT_WORKING_BRANCH = 'master'; + process.env SEMAPHORE_GIT_PR_NUMBER = '456'; const git = { head: { @@ -678,6 +679,7 @@ const testSemaphore = (sut, done) => { should.not.exist(err); options.service_name.should.equal('semaphore'); options.service_job_id.should.equal('1234'); + options.service_pull_request.should.equal('456'); options.git.should.eql(git); done(); });