Skip to content

Commit

Permalink
HPCC4J-676 Migrate Jirabot Improvements
Browse files Browse the repository at this point in the history
- Updated out of date actions
- Moved to using more secure ENV variables to echo Github variables
- Fixed project prefix comparison

Signed-off-by: James McMullan [email protected]
  • Loading branch information
jpmcmu committed Jan 7, 2025
1 parent 6abcb06 commit ef20af9
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/JirabotMerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@ jobs:
if: github.event.pull_request.merged == true
steps:
- name: "Debug Vars"
env:
JIRA_URL : ${{ vars.JIRA_URL }}
PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }}
PULL_REQUEST_TITLE : ${{ github.event.pull_request.title }}
PULL_REQUEST_AUTHOR_NAME : ${{ github.event.pull_request.user.login }}
PULL_URL: ${{ github.event.pull_request.html_url }}
COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
echo "JIRA_URL: ${{ vars.JIRA_URL }}"
echo "Pull Request Number: ${{ github.event.pull_request.number }}"
echo "Pull Request Title: ${{ github.event.pull_request.title }}"
echo "Pull Request Author Name: ${{ github.event.pull_request.user.login }}"
echo "Pull Request URL: ${{ github.event.pull_request.html_url }}"
echo "Comments URL: ${{ github.event.pull_request.comments_url }}"
echo "Branch Name: ${{ github.ref_name }}"
- uses: "actions/setup-python@v2"
echo "JIRA_URL: $JIRA_URL"
echo "Pull Request Number: $PULL_REQUEST_NUMBER"
echo "Pull Request Title: $PULL_REQUEST_TITLE"
echo "Pull Request Author Name: $PULL_REQUEST_AUTHOR_NAME"
echo "Pull Request URL: $PULL_URL"
echo "Comments URL: $COMMENTS_URL"
echo "Branch Name: $BRANCH_NAME"
- uses: "actions/setup-python@v5"
with:
python-version: "3.8"
- name: "Install dependencies"
Expand All @@ -33,7 +41,7 @@ jobs:
python -m pip install --upgrade atlassian-python-api
python -m pip install --upgrade jira
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
Expand All @@ -51,6 +59,7 @@ jobs:
COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.ref_name }}
shell: python
run: |
import os
import re
Expand Down Expand Up @@ -255,7 +264,7 @@ jobs:
sys.exit(1)
project_prefixes = projectConfig.get('projectPrefixes')
if not project_prefixes:
if project_prefixes is None:
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)
Expand Down Expand Up @@ -291,5 +300,4 @@ jobs:
else:
print('Unable to find Jira issue name in title')
print(result)
shell: python
print(result)

0 comments on commit ef20af9

Please sign in to comment.