Created
July 26, 2018 07:57
-
-
Save madhukar93/a929e24ad59d192ae9a470423b1eb8b1 to your computer and use it in GitHub Desktop.
branch name should contain issue type and issue ID
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
def check_branch_name = { name -> | |
jira_issue_re = /.*\(((?<!([A-Z]{1,10})-?)[A-Z]+-\d+)\)$/ // any chars followed by jira issue ID at the end | |
pr_type_re = /^(?i)(bugfix|enhancement|feature|hotfix)-.*/ // pr type followed by any chars | |
name =~ jira_issue_re && name =~ pr_type_re | |
} | |
check_branch_name "BGfix-hello world-(CN-85)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment