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 25, 2024
1 parent 434557e commit 85b55b9
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 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,21 @@ 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 not project_prefixes:
print('Error: PROJECT_CONFIG is missing required field: projectPrefixes. Add a "projectPrefixes" JSON array of project prefix strings to the PROJECT_CONFIG.')
sys.exit(1)
if not isinstance(project_prefixes, list):
print('Error: PROJECT_CONFIG field projectPrefixes is not a valid JSON array, aborting.')
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 = issuem.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 85b55b9

Please sign in to comment.