Skip to content

Commit

Permalink
feat: support greenkeeper enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
finnp committed Jun 8, 2017
1 parent 1e989ef commit 796633c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions update.js
Expand Up @@ -32,6 +32,11 @@ module.exports = function update () {
return console.error('This build should not update the lockfile. It could be a PR, not a branch build.')
}

// legacy support
if (config.branchPrefix === 'greenkeeper/' && info.branchName.startsWith('greenkeeper-')) {
config.branchPrefix = 'greenkeeper-'
}

if (!info.branchName.startsWith(config.branchPrefix)) {
return console.error('Not a Greenkeeper branch')
}
Expand Down
10 changes: 9 additions & 1 deletion upload.js
Expand Up @@ -8,11 +8,19 @@ const info = require('./ci-services')()
const env = process.env

module.exports = function upload () {
// legacy support
if (config.branchPrefix === 'greenkeeper/' && info.branchName.startsWith('greenkeeper-')) {
config.branchPrefix = 'greenkeeper-'
}

if (!info.branchName.startsWith(config.branchPrefix)) {
return console.error('Not a Greenkeeper branch')
}

if (info.branchName === (config.branchPrefix + 'initial')) {
const isInitial = info.branchName === (config.branchPrefix + 'initial') ||
info.branchName === (config.branchPrefix + 'update-all')

if (isInitial) {
return console.error('Not a Greenkeeper update pull request')
}

Expand Down

0 comments on commit 796633c

Please sign in to comment.