Skip to content

Commit dad60c1

Browse files
authored
Merge pull request #186 from pcatalini/DAITDS-190
DAITDS 190
2 parents 7af14ef + e12b57b commit dad60c1

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/issue_notify.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This workflow is triggered by github issue and creates a jira ticket in the respective configured account
2+
#
3+
name: issue_notify
4+
on:
5+
issues:
6+
types: [opened]
7+
workflow_dispatch:
8+
jobs:
9+
jira_job:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Jira Login
13+
uses: atlassian/gajira-login@v2.0.0
14+
env:
15+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL}}
16+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL}}
17+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN}}
18+
- name: Jira Create issue
19+
id: jira_ticket
20+
uses: atlassian/gajira-create@v2.0.1
21+
with:
22+
project: ${{secrets.JIRA_PROJECT_KEY}}
23+
issuetype: Bug
24+
summary: '[ns1-terraform] ${{github.event.issue.title}}'
25+
description: ${{github.event.issue.body}} see more at ${{github.event.issue.html_url}}

.github/workflows/pr_notify.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow is triggered by pull request and creates an jira ticket if the ticket does not exist in jira
2+
#
3+
name: pr_notify
4+
on:
5+
pull_request:
6+
branches: [master]
7+
jobs:
8+
jira_job:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Jira Login
12+
uses: atlassian/gajira-login@v2.0.0
13+
env:
14+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
15+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
16+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
17+
# try to find jira key in the PR title
18+
- name: Find jirakey in title
19+
id: jira_founded_ticket
20+
uses: atlassian/gajira-find-issue-key@master
21+
continue-on-error: true
22+
with:
23+
string: ${{ github.event.pull_request.title }}
24+
# if there is no ticket associated then create a new one
25+
- name: Jira Create issue
26+
id: jira_ticket
27+
if: ${{!steps.jira_founded_ticket.outputs.issue}}
28+
uses: atlassian/gajira-create@v2.0.1
29+
with:
30+
project: ${{secrets.JIRA_PROJECT_KEY}}
31+
issuetype: Task
32+
summary: ${{github.event.pull_request.title}}
33+
description: ${{github.event.pull_request.body}} see more at ${{github.event.pull_request.html_url}}

0 commit comments

Comments
 (0)