Add functionality to cross-post approved bounties to an additional Slack room

This commit is contained in:
Pedro Pombeiro 2018-02-22 16:38:28 +01:00
parent 519d0dfed9
commit 8ddcfee6aa
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
2 changed files with 9 additions and 0 deletions

View File

@ -118,6 +118,7 @@ Examples of settings that can be configured:
- `bounty-project-board/awaiting-approval-column-name`: Name of the column in the bounty project board to group issues that are awaiting for bounty approval - `bounty-project-board/awaiting-approval-column-name`: Name of the column in the bounty project board to group issues that are awaiting for bounty approval
- `bounty-project-board/awaiting-approval-label-name`: Name of the label used in issues to declare that an issue is awaiting approval to become a bounty - `bounty-project-board/awaiting-approval-label-name`: Name of the label used in issues to declare that an issue is awaiting approval to become a bounty
- `bounty-project-board/bounty-label-name`: Name of the label used in issues to declare that an issue is a bounty - `bounty-project-board/bounty-label-name`: Name of the label used in issues to declare that an issue is a bounty
- `bounty-project-board/post-approved-bounties-to-slack-room`: Name of the Slack room where to cross-post approved bounties
- Automated tests settings: - Automated tests settings:
- `automated-tests/repo-full-name`: Full name of the repo to watch in project cards in order to automatically run automated tests CI job (e.g. `status-im/status-react`) - `automated-tests/repo-full-name`: Full name of the repo to watch in project cards in order to automatically run automated tests CI job (e.g. `status-im/status-react`)

View File

@ -105,6 +105,14 @@ async function assignIssueToBountyAwaitingForApproval (context, robot, assign) {
if (slackMessage && !process.env.DRY_RUN_BOUNTY_APPROVAL) { if (slackMessage && !process.env.DRY_RUN_BOUNTY_APPROVAL) {
// Send message to Slack // Send message to Slack
slackHelper.sendMessage(robot, config.slack.notification.room, slackMessage) slackHelper.sendMessage(robot, config.slack.notification.room, slackMessage)
// Cross-post approved bounties to a predefined room
if (!assign && isOfficialBounty) {
const slackRoom = projectBoardConfig['post-approved-bounties-to-slack-room']
if (slackRoom) {
slackHelper.sendMessage(robot, slackRoom, slackMessage)
}
}
} }
} }