-
Notifications
You must be signed in to change notification settings - Fork 844
45 lines (39 loc) · 1.29 KB
/
update_issue_in_jira.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
on:
issue_comment:
types:
- created
name: Create a comment for ticket in Jira
jobs:
create-comment-for-ticket-in-jira:
if: ${{ !github.event.issue.pull_request }}
name: Ticket comment creation
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 commented by *${{ github.event.comment.user.login }}*:
${{ github.event.comment.body }}