generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.16 KB
/
gajira.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
name: Raise Jira Issue
on:
pull_request:
types: [opened, reopened]
jobs:
gajira:
name: Raise Jira Issue
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.title, 'snyk') }}
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: Process PR data
id: process_pr_data
run: |
repo_name=$(basename ${{ github.repository }})
pr_body="${{ github.event.pull_request.body }}"
stripped_body=$(echo "$pr_body" | sed 's/<[^>]*>//g' | sed "s/'//g" | sed 's/"//g')
echo "repo_name=$repo_name" >> $GITHUB_OUTPUT
echo "stripped_body=$stripped_body" >> $GITHUB_OUTPUT
- name: Create
id: create
uses: atlassian/gajira-create@master
with:
project: LGA
issuetype: Task
summary: "[Snyk] - ${{ steps.process_pr_data.outputs.repo_name }} - ${{ github.event.pull_request.title }}"
description: ${{ steps.process_pr_data.outputs.stripped_body }}