From f49ac933db3c20445f2a40aa8611ca800e89febf Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Wed, 5 Jun 2019 18:12:36 -0400 Subject: [PATCH] fix: fix CircleCi PR detection --- services/circleci.js | 4 +--- test/services/circleci.test.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/services/circleci.js b/services/circleci.js index cffdcc0..6b178d5 100644 --- a/services/circleci.js +++ b/services/circleci.js @@ -1,13 +1,11 @@ // https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables -const {prNumber} = require('../lib/utils'); - module.exports = { detect({env}) { return Boolean(env.CIRCLECI); }, configuration({env}) { - const pr = env.CIRCLE_PR_NUMBER || prNumber(env.CIRCLE_PULL_REQUEST || env.CI_PULL_REQUEST); + const pr = env.CIRCLE_PR_NUMBER; const isPr = Boolean(pr); return { diff --git a/test/services/circleci.test.js b/test/services/circleci.test.js index f70fb0b..eac089d 100644 --- a/test/services/circleci.test.js +++ b/test/services/circleci.test.js @@ -32,7 +32,7 @@ test('Push', t => { test('PR 1.0', t => { t.deepEqual( - circle.configuration({env: Object.assign({}, env, {CIRCLE_BRANCH: 'pr-branch', CI_PULL_REQUEST: 'uri/pr/10'})}), + circle.configuration({env: Object.assign({}, env, {CIRCLE_BRANCH: 'pr-branch', CIRCLE_PR_NUMBER: '10'})}), { name: 'CircleCI', service: 'circleci', @@ -52,7 +52,7 @@ test('PR 1.0', t => { test('PR 2.0', t => { t.deepEqual( - circle.configuration({env: Object.assign({}, env, {CIRCLE_BRANCH: 'pr-branch', CIRCLE_PULL_REQUEST: 'uri/pr/10'})}), + circle.configuration({env: Object.assign({}, env, {CIRCLE_BRANCH: 'pr-branch', CIRCLE_PR_NUMBER: '10'})}), { name: 'CircleCI', service: 'circleci',