hotfix_branch = "hotfix/asf" release_branch = "release/asf" master_branch = "master" feature_branch = "1923_core_something" def check_branch(source_branch, squash) is_release_branch = (/^(release\/).*$/.match(source_branch)) is_hotfix_branch = (/^(hotfix\/).*$/.match(source_branch)) is_master_branch = source_branch == "master" #puts "🏸 Please check the squash option in the merge request settings. Think about our nice changelog 🙏" unless is_release_branch || is_hotfix_branch || is_master_branch || squash unless squash || is_release_branch || is_hotfix_branch || is_master_branch puts "🏸 Please check the squash option in the merge request settings. Think about our nice changelog 🙏" else puts "MR ok!" end end puts "* Checking hotfix branch with squash" check_branch(hotfix_branch, true) puts "* Checking hotfix branch without squash" check_branch(hotfix_branch, false) puts "* Checking release branch with squash" check_branch(release_branch, true) puts "* Checking release branch without squash" check_branch(release_branch, false) puts "* Checking master branch with squash" check_branch(master_branch, true) puts "* Checking master branch without squash" check_branch(master_branch, false) puts "* Checking feature branch with squash" check_branch(feature_branch, true) puts "* Checking feature branch without squash" check_branch(feature_branch, false)
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more