diff --git a/dev-support/git-jira-validation/git_jira_fix_version_check.py b/dev-support/git-jira-validation/git_jira_fix_version_check.py index c2e12a13aa..513cc8e25f 100644 --- a/dev-support/git-jira-validation/git_jira_fix_version_check.py +++ b/dev-support/git-jira-validation/git_jira_fix_version_check.py @@ -71,10 +71,9 @@ print("Commit seems reverted. \t\t\t Commit: " + commit) continue ACTUAL_PROJECT_JIRA = None - for project_jira in project_jira_keys: - if project_jira in commit: - ACTUAL_PROJECT_JIRA = project_jira - break + matches = re.findall('|'.join(project_jira_keys), commit) + if matches: + ACTUAL_PROJECT_JIRA = matches[0] if not ACTUAL_PROJECT_JIRA: print("WARN: Jira not found. \t\t\t Commit: " + commit) continue