Skip to content

Commit

Permalink
HPCC4J-532 Jirabot should translate hpcc4j prefix (#633)
Browse files Browse the repository at this point in the history
- Added logic to translate hpcc4j prefix

Signed-off-by: James McMullan [email protected]

Signed-off-by: James McMullan [email protected]
  • Loading branch information
jpmcmu authored Aug 18, 2023
1 parent 6174408 commit a5611b8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/Jirabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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']
Expand All @@ -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':
Expand Down Expand Up @@ -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

0 comments on commit a5611b8

Please sign in to comment.