Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ACHIEVEMENT] Bi-winning achievement (#37)
* bi-winning achievement for all commits having success statuses * change <br> to \n :-) * change the wording a bit
- Loading branch information
1 parent
eb743ad
commit 9bd8dd2
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var _ = require('lodash'); | ||
|
||
var biWinning = { | ||
name: 'bi-winning', | ||
check: function(pullRequest, shall) { | ||
if (_.every(pullRequest.commits, allStatusesPassed)) { | ||
|
||
var achievement = { | ||
avatar: 'images/achievements/biWinning.achievement.jpg', | ||
name: 'BI-WINNING!', | ||
short: 'I\'m bi-winning. I win here and I win there', | ||
description: [ | ||
'All the commits in your pull-request have passing statuses! WINNING!', | ||
'\n\n', | ||
'I\'m different. I have a different constitution, I have a different brain, I have a different heart. I got tiger blood, man. Dying\'s for fools, dying\'s for amateurs.' | ||
].join(''), | ||
relatedPullRequest: pullRequest._id | ||
}; | ||
|
||
shall.grant(pullRequest.creator.username, achievement); | ||
} | ||
} | ||
}; | ||
|
||
|
||
function allStatusesPassed(commit) { | ||
return _.every(commit.statuses, { state: 'success' }) | ||
} | ||
|
||
module.exports = biWinning; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.