From a5611b82778b32dc8b91f2332b6eb8ec40d806d5 Mon Sep 17 00:00:00 2001 From: James McMullan Date: Fri, 18 Aug 2023 10:29:36 -0400 Subject: [PATCH] HPCC4J-532 Jirabot should translate hpcc4j prefix (#633) - Added logic to translate hpcc4j prefix Signed-off-by: James McMullan James.McMullan@lexisnexis.com Signed-off-by: James McMullan James.McMullan@lexisnexis.com --- .github/workflows/Jirabot.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Jirabot.yml b/.github/workflows/Jirabot.yml index 948bccbac..0f28a2876 100644 --- a/.github/workflows/Jirabot.yml +++ b/.github/workflows/Jirabot.yml @@ -25,7 +25,7 @@ jobs: python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade jira - name: "Run" - env: + env: JIRABOT_USERNAME : ${{ secrets.JIRABOT_USERNAME }} JIRABOT_PASSWORD : ${{ secrets.JIRABOT_PASSWORD }} JIRA_URL : ${{ secrets.JIRA_URL }} @@ -35,12 +35,12 @@ jobs: PULL_URL: ${{ github.event.pull_request.html_url }} COMMENTS_URL: ${{ github.event.pull_request.comments_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + run: | import os import re from jira.client import JIRA - + jirabot_user = os.environ['JIRABOT_USERNAME'] jirabot_pass = os.environ['JIRABOT_PASSWORD'] jira_url = os.environ['JIRA_URL'] @@ -50,12 +50,13 @@ jobs: comments_url = os.environ['COMMENTS_URL'] pull_url = os.environ['PULL_URL'] github_token = os.environ['GITHUB_TOKEN'] - + print("%s %s %s" % (title, user, comments_url)) status = '' issuem = re.search("(HPCC4J|JAPI)-[0-9]+", title) if issuem: - issue_name = issuem.group() + nameCorrectionPattern = re.compile("hpcc4j", re.IGNORECASE) + issue_name = nameCorrectionPattern.sub("JAPI",issuem.group()) if user == 'kunalaswani': user = 'kunal.aswani' if user == 'timothyklemm': @@ -96,6 +97,6 @@ jobs: status += 'Jira updated' print('curl -X POST %s -H "Content-Type: application/json" -H "Authorization: token %s" --data \'{ "body": "%s" }\'' % ( comments_url, github_token, status )) os.system('curl -X POST %s -H "Content-Type: application/json" -H "Authorization: token %s" --data \'{ "body": "%s" }\'' % ( comments_url, github_token, status )) - + print(status) shell: python