Skip to content

Commit

Permalink
refactor: don't check for payment when PR is opened and repo is public
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehner committed Jan 24, 2018
1 parent cac2e7a commit 73799d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jobs/github-event/pull_request/opened.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ module.exports = async function (data) {
createdByUser: true
}
)

if (!repoDoc.private) {
return
}

const ghqueue = githubQueue(installation.id)

const billingAccount = await getActiveBilling(accountId)
const hasBillingAccount = !!billingAccount
const accountNeedsMarketplaceUpgrade = await getAccountNeedsMarketplaceUpgrade(accountId)

if (repoDoc.private && ((!hasBillingAccount || accountNeedsMarketplaceUpgrade))) {
if (!hasBillingAccount || accountNeedsMarketplaceUpgrade) {
const targetUrl = accountNeedsMarketplaceUpgrade ? 'https://github.com/marketplace/greenkeeper/' : 'https://account.greenkeeper.io/'

await ghqueue.write(github => github.repos.createStatus({
Expand Down

0 comments on commit 73799d1

Please sign in to comment.