Skip to content

Commit

Permalink
HPCC4J-651 JirabotMerge: Allow multiple projects to be configured
Browse files Browse the repository at this point in the history
- Modified script to allow multiple projects to be controlled from a single script
- Fixed regex warning on escaped characters

Signed-off-by: James McMullan [email protected]
  • Loading branch information
jpmcmu committed Sep 20, 2024
1 parent 434557e commit 046916c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/JirabotMerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ jobs:
releaseTagPattern = releaseTagPrefix
if major is not None:
releaseTagPattern += str(major) + '\.'
releaseTagPattern += str(major) + '\\.'
else:
releaseTagPattern += '[0-9]+\.'
releaseTagPattern += '[0-9]+\\.'
if minor is not None:
releaseTagPattern += str(minor) + '\.'
releaseTagPattern += str(minor) + '\\.'
else:
releaseTagPattern += '[0-9]+\.'
releaseTagPattern += '[0-9]+\\.'
if point is not None:
releaseTagPattern += str(point) + '(-[0-9]+)?'
Expand Down Expand Up @@ -254,14 +254,17 @@ jobs:
print('Error: PROJECT_CONFIG is missing required fields: tagPrefix and/or tagPostfix')
sys.exit(1)
project_name = projectConfig.get('projectName')
if project_name is None:
print('Error: PROJECT_CONFIG is missing required field: projectName')
project_prefixes = projectConfig.get('projectPrefixes')
if project_prefixes is None:
print('Error: PROJECT_CONFIG is missing required field: projectPrefixes')
sys.exit(1)
project_list_regex = '|'.join(project_prefixes)
result = ''
issuem = re.search("(" + project_name + ")-[0-9]+", title, re.IGNORECASE)
issuem = re.search("(" + project_list_regex + ")-[0-9]+", title, re.IGNORECASE)
if issuem:
project_name = isuem.group(1)
issue_name = issuem.group()
jira = Jira(url=jira_url, username=jirabot_user, password=jirabot_pass, cloud=True)
Expand Down

0 comments on commit 046916c

Please sign in to comment.