Skip to content
This repository was archived by the owner on Jan 14, 2018. It is now read-only.

Commit 38574e8

Browse files
committed
fix(condition-travis): use correct BUILD_MINION variable
BREAKING CHANGE: Doesn't work with BUILD_LEADER=NO any longer.
1 parent 3c5f4c1 commit 38574e8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { unlinkSync } = require('fs')
2+
13
const SRError = require('@semantic-release/error')
24

35
module.exports = function (options, pkg, argv, env, cb) {
@@ -10,8 +12,9 @@ module.exports = function (options, pkg, argv, env, cb) {
1012

1113
if (branch !== env.TRAVIS_BRANCH) return cb(new SRError(`Branch is not ${branch}`, 'EBRANCHMISMATCH'))
1214

13-
if (env.hasOwnProperty('BUILD_LEADER')) {
14-
if (env.BUILD_LEADER !== 'YES') return cb(new SRError('Not publishing from minion', 'ENOBUILDLEADER'))
15+
if (env.BUILD_MINION === 'YES') return cb(new SRError('Not publishing from minion', 'ENOBUILDLEADER'))
16+
17+
if (env.BUILD_LEADER === 'YES') {
1518
if (env.BUILD_AGGREGATE_STATUS !== 'others_succeeded') return cb(new SRError('Not publishing when other jobs in the build matrix fail.', 'EOTHERSFAILED'))
1619
}
1720

test/specs/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test('raise errors in travis environment', (t) => {
8282
condition({}, {}, {}, {
8383
TRAVIS: 'true',
8484
TRAVIS_BRANCH: 'master',
85-
BUILD_LEADER: 'NO'
85+
BUILD_MINION: 'YES'
8686
}, (err) => {
8787
tt.ok(err instanceof SRError)
8888
tt.is(err.code, 'ENOBUILDLEADER')

0 commit comments

Comments
 (0)