Skip to content

Commit

Permalink
Merge pull request #23 from futuredapp/feature/main-branch
Browse files Browse the repository at this point in the history
Feature: Main branch
  • Loading branch information
skywall authored Sep 29, 2020
2 parents 755324d + f2b721f commit 8a0c826
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ branch_name_pattern = /^(feature|hotfix|fix)\/([A-Z]{2,})-\d+-/
# Convenience variables
has_correct_prefix = github.branch_for_head.match(/^(feature|hotfix|fix|release|housekeep)\//)
is_feature_or_fix = github.branch_for_head.match(/^(feature|hotfix|fix)\//)
can_be_merged_to_master = github.branch_for_head.match(/^((release|hotfix)\/|develop$)/)
can_be_merged_to_main = github.branch_for_head.match(/^((release|hotfix)\/|develop$)/)

branch_contains_jira_id = github.branch_for_head.match(branch_name_pattern)
title_contains_jira_id = github.pr_title.match(pr_title_pattern)
Expand All @@ -23,7 +23,9 @@ is_pr_big = git.insertions > max_pr_length
github.dismiss_out_of_range_messages

# Throw errors
fail("Only develop, hotfix and release can point to master.") if !can_be_merged_to_master and github.branch_for_base == "master"
if !can_be_merged_to_main and ["main", "master"].include? github.branch_for_base then
fail("Only develop, hotfix and release can point to main.")
end

# Throw descriptive warnings
warn("Branch name should have `release/`, `hotfix/`, `fix/`, `housekeep/` or `feature/` prefix.") if !has_correct_prefix
Expand Down
2 changes: 1 addition & 1 deletion thefuntasty_danger.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Gem::Specification.new do |spec|
spec.name = "thefuntasty_danger"
spec.version = "0.6.0"
spec.version = "0.7.0"
spec.authors = ["Matěj Kašpar Jirásek"]
spec.email = ["[email protected]"]

Expand Down

0 comments on commit 8a0c826

Please sign in to comment.