Skip to content

Commit 7e5a195

Browse files
committed
feat: "<account> is enabled for the pro plan for free" message in status summary
1 parent 5eef822 commit 7e5a195

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎lib/pro/set-status.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = setStatusPro
22

33
const getAppConfig = require('../app-config')
4-
// const PRO_PLAN_FOR_FREE = require('../../pro-plan-for-free')
4+
const PRO_PLAN_FOR_FREE = require('../../pro-plan-for-free')
55

66
const locationLabel = {
77
title: 'title',
@@ -10,7 +10,7 @@ const locationLabel = {
1010
}
1111

1212
function setStatusPro (newStatus, context) {
13-
const { pull_request: pullRequest } = context.payload
13+
const { repository, pull_request: pullRequest } = context.payload
1414
const { name } = getAppConfig()
1515

1616
const checkOptions = {
@@ -70,13 +70,13 @@ ${newStatus.config}
7070
})
7171
}
7272

73-
// uncomment once WIP is listed in marketplace
74-
// if (PRO_PLAN_FOR_FREE.includes(repo.owner.login)) {
75-
// checkOptions.output.summary += `
76-
// ### 🆓💸 The account ${repo.owner.login} is [enabled for the pro plan for free](https://github.com/wip/app/blob/master/pro-plan-for-free.js)
77-
//
78-
// Please consider [signing up for the pro plan](https://github.com/marketplace/wip), all revenue is donated to [Rails Girls Summer of Code](https://railsgirlssummerofcode.org/).`
79-
// }
73+
/* istanbul ignore next */
74+
if (PRO_PLAN_FOR_FREE.includes(repository.owner.login)) {
75+
checkOptions.output.summary += `
76+
### 🆓💸 The account ${repository.owner.login} is [enabled for the pro plan for free](https://github.com/wip/app/blob/master/pro-plan-for-free.js)
77+
78+
Please consider [signing up for the pro plan](https://github.com/marketplace/wip), all revenue is donated to [Rails Girls Summer of Code](https://railsgirlssummerofcode.org/).`
79+
}
8080

8181
return context.github.checks.create(context.repo(checkOptions))
8282
}

0 commit comments

Comments
 (0)