-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Dallinger/danger
Check PRs with Danger
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
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
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,19 @@ | ||
# Note contributors not in the organization. | ||
unless github.api.organization_member?('Dallinger', github.pr_author) | ||
message("@#{github.pr_author}, would you like to join the Dallinger org.?") | ||
end | ||
|
||
# Encourage writing up some reasoning about the PR. | ||
if github.pr_body.length < 5 | ||
fail("Please provide a summary in the Pull Request description.") | ||
end | ||
|
||
# Ensure a clean commit history. | ||
if git.commits.any? { |c| c.message =~ /^Merge branch/ } | ||
fail('Please rebase to get rid of the merge commits.') | ||
end | ||
|
||
# Require labels on PRs. | ||
has_enhancement_label = github.pr_labels.include?("enhancement") | ||
has_bug_label = github.pr_labels.include?("bug") | ||
warn("Please label as 'enhancement', 'bug', 'demo', or 'release'.", sticky: true) if !has_enhancement_label && !has_bug_label |
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,3 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "danger" |