From 35a5ef667c22d5b5348ce97b76c2daaee80887c6 Mon Sep 17 00:00:00 2001 From: James McMullan Date: Thu, 19 Sep 2024 21:17:25 -0400 Subject: [PATCH] HPCC4J-651 JirabotMerge: Allow multiple projects to be configured - Modified script to allow multiple projects to be controlled from a single script - Fixed regex warning on escaped characters Signed-off-by: James McMullan James.McMullan@lexisnexis.com --- .github/workflows/JirabotMerge.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/JirabotMerge.yml b/.github/workflows/JirabotMerge.yml index 1aab53288..1bd98337d 100644 --- a/.github/workflows/JirabotMerge.yml +++ b/.github/workflows/JirabotMerge.yml @@ -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]+)?' @@ -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 = issuem.group(1) issue_name = issuem.group() jira = Jira(url=jira_url, username=jirabot_user, password=jirabot_pass, cloud=True)