From 68260b19ca780f36997b4ce722a9e526da233a70 Mon Sep 17 00:00:00 2001 From: finnp Date: Sun, 21 May 2017 01:25:32 +0200 Subject: [PATCH] feat(create-version-branch): ignore in-range updates if a lockfile is present --- jobs/create-version-branch.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jobs/create-version-branch.js b/jobs/create-version-branch.js index 8df9369b..b8f8e533 100644 --- a/jobs/create-version-branch.js +++ b/jobs/create-version-branch.js @@ -40,6 +40,11 @@ module.exports = async function ( const installation = await installations.get(accountId) const repository = await repositories.get(repositoryId) + const satisfies = semver.satisfies(version, oldVersion) + const lockFiles = ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'] + const hasLockFile = _.some(_.pick(repository.files, lockFiles)) + if (satisfies && hasLockFile) return + const billing = await getActiveBilling(accountId) if (repository.private && !billing) return @@ -71,8 +76,6 @@ module.exports = async function ( return parsed.toString() } - const satisfies = semver.satisfies(version, oldVersion) - const openPR = _.get( await repositories.query('pr_open_by_dependency', { key: [repositoryId, dependency],