Skip to content

Commit

Permalink
Merge pull request #57 from job13er/restore-default-behavior
Browse files Browse the repository at this point in the history
Restore default behavior for master branch
  • Loading branch information
sandersky committed Sep 15, 2016
2 parents 4890660 + 32ffda2 commit f245b8d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function processEnv (config) {
config.ci.buildNumber = process.env[config.ci.env.buildNumber]
config.prNumber = process.env[config.ci.env.pr]
config.isPr = config.prNumber !== 'false'
config.branch = process.env[config.ci.env.branch]
config.branch = process.env[config.ci.env.branch] || 'master'

logger.log(`pr-bumper::config: prNumber [${config.prNumber}], isPr [${config.isPr}]`)

Expand Down
15 changes: 15 additions & 0 deletions tests/utils-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,21 @@ describe('utils', () => {
expect(config.prNumber).to.be.equal('false')
})
})

describe('when no branch env is given', () => {
beforeEach(() => {
delete _config.ci.env.branch

saveEnv(Object.keys(env), realEnv)
setEnv(env)

config = utils.getConfig(_config)
})

it('should default to master branch', () => {
expect(config.branch).to.be.equal('master')
})
})
})
})

Expand Down

0 comments on commit f245b8d

Please sign in to comment.