-
Notifications
You must be signed in to change notification settings - Fork 26
61 lines (56 loc) · 2.01 KB
/
jira_notify.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Notify Jira
on:
workflow_call:
inputs:
title:
description: 'Issue title'
required: true
type: string
body:
description: 'Body'
required: true
type: string
html_url:
description: 'URL'
required: true
type: string
repo:
description: 'Repository name'
required: true
type: string
jobs:
notify_jira:
runs-on: ubuntu-latest
env:
JIRA_URL: "https://checkmarx.atlassian.net/"
steps:
- name: Jira Login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c #v3
env:
JIRA_BASE_URL: ${{ env.JIRA_URL }}
JIRA_USER_EMAIL: ${{ secrets.AST_JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.AST_JIRA_API_TOKEN }}
- name: Jira Create issue
id: create_jira_issue
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec #v3
with:
project: AST
issuetype: Task
summary: '${{inputs.repo}} ${{inputs.title}}'
description: ${{inputs.body}} see more at ${{inputs.html_url}}
fields: ${{ secrets.AST_JIRA_FIELDS}}
- name: Add comment to GitHub issue
uses: actions/[email protected]
with:
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Internal Jira issue: [${{ steps.create_jira_issue.outputs.issue }}](${{ env.JIRA_URL }}/browse/${{ steps.create_jira_issue.outputs.issue }})'
})
- name: Send a teams notification
uses: thechetantalwar/teams-notify@8a78811f5e8f58cdd204efebd79158006428c46b #v2
with:
teams_webhook_url: ${{ secrets.TEAMS_WEBHOOK_URI }}
message: "Github issue created ${{ github.repository }} - Link - ${{inputs.html_url}} - Jira Issue - ${{ env.JIRA_URL }}/browse/${{ steps.create_jira_issue.outputs.issue }}"