Skip to content

Commit

Permalink
Create close_issue.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
imbeacon authored Jan 19, 2024
1 parent 644ff0d commit f451eb7
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/close_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
issues:
types:
- closed

name: Move ticket to done

jobs:
close-ticket-in-jira:
if: ${{ !github.event.issue.pull_request }}
name: Close ticket
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Find Comment
uses: peter-evans/find-comment@v2
id: find_comment
with:
issue-number: ${{ github.event.issue.number }}
comment-author: 'github-actions[bot]'
direction: first
nth: 0

- name: Find Jira ticket
if: steps.find_comment.outputs.comment-id != ''
id: find_ticket
uses: atlassian/gajira-find-issue-key@v3
with:
string: ${{ steps.find_comment.outputs.comment-body }}

- name: Update Jira ticket
if: steps.find_ticket.outputs.issue != ''
uses: atlassian/gajira-comment@v3
with:
issue: ${{ steps.find_ticket.outputs.issue }}
comment: |
Github issue was closed by *${{ github.event.sender.login }}*
- name: Move to Done
if: steps.find_ticket.outputs.issue != ''
id: transition
uses: atlassian/gajira-transition@v3
with:
issue: ${{ steps.find_ticket.outputs.issue }}
transition: "Done"

0 comments on commit f451eb7

Please sign in to comment.