-
Notifications
You must be signed in to change notification settings - Fork 125
45 lines (39 loc) · 1.22 KB
/
jira_update_issue_reopen.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
name: Reopen Jira Ticket When Issue Reopens
on:
issues:
types:
- reopened
pull_request_target:
types:
- reopened
workflow_call:
jobs:
update_jira_status:
name: Set Jira Status To Done
runs-on: ubuntu-latest
permissions: write-all
steps:
# Look through all comments in issue and get contents of comment that
# includes text PETOSS
- name: Find Jira ticket Id in issue comments
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
body-includes: PETOSS
comment-author: github-actions[bot]
direction: last
- name: Checkout
uses: actions/checkout@master
- 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 }}
# Transition jira ticket identified in first step to status of backlog
- name: Update Jira ticket status
uses: atlassian/gajira-transition@v3
with:
issue: ${{ steps.fc.outputs.comment-body }}
transition: "Backlog"