-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-32688 Add JirabotMerge Github Action #19135
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32688 Jirabot Action Result: |
Notes on merge script: The script uses the target branch and the git tags to determine the correct fix versions to add to the Jira issue. The logic for this is as follow:
Here is an example run from my fork merging into master. It added 9.10.0 to the Jira issue: https://github.com/jpmcmu/HPCC-Platform/actions/runs/10951362829 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good afaics. I have added the relevant variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I didn't review the python code...
.github/workflows/jirabot-merge.yml
Outdated
python -m pip install --upgrade atlassian-python-api | ||
python -m pip install --upgrade jira | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be version 4
.github/workflows/jirabot-merge.yml
Outdated
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be version 5?
.github/workflows/jirabot-merge.yml
Outdated
print('Unable to find Jira issue name in title') | ||
|
||
print(result) | ||
shell: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Move shell to above the run for consistency with other actions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor changes
@GordonSmith thanks for the review, made those changes |
@jpmcmu please look at the security warning - which does indicate a real vulnerability |
- Added a Github action to update Jira issues upon PR merger Signed-off-by: James McMullan James.McMullan@lexisnexis.com
@ghalliday Addressed the security issue and squashed |
@jpmcmu can you explain how your change avoids the security problem? Will it not sill be possible for someone to insert arbitrary text into a title, which will then be echoed? I haven't understood why putting it in an environment variable first helps (other than confusing the checking tool) |
@ghalliday Good question, I followed Github's recommendations on how to address the issue, but should have added a comment about why the changes addressed the security issue. (GitHubs: recommendation: https://github.com/hpcc-systems/HPCC-Platform/security/code-scanning/278) Bash apparently treats the environment variable as a single string which is escaped and prevents injection. |
986b454
into
hpcc-systems:candidate-9.2.x
Jirabot Action Result: |
Signed-off-by: James McMullan James.McMullan@lexisnexis.com
Type of change:
Checklist:
Smoketest:
Testing: