-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (65 loc) · 2.05 KB
/
issue.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
62
63
64
65
66
67
68
69
name: New issue
on:
issues:
types: [opened]
jobs:
jira_task:
name: Create Jira issue
runs-on: ubuntu-22.04
steps:
- name: Login
uses: atlassian/[email protected]
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Parse the priority label into a Jira priority
id: set_priority_var
env:
LABELS: ${{ join(github.event.issue.labels.*.name, ' ') }}
run: |
MY_RESULT=""
for label in $LABELS
do
case $label in
P-low)
MY_RESULT=Low
break;;
P-medium)
MY_RESULT=Medium
break;;
P-high)
MY_RESULT=High
break;;
P-critical)
MY_RESULT=Highest
break;;
esac
done
if [ ! -z $MY_RESULT ]
then
MY_RESULT=", \"priority\": { \"name\": \"$MY_RESULT\" }"
fi
echo "JIRA_PRIORITY_FIELD=$MY_RESULT" >> $GITHUB_OUTPUT
- name: Create Bug
uses: atlassian/[email protected]
if: ${{ contains(github.event.issue.labels.*.name, 'bug') }}
env:
JIRA_PRIORITY_FIELD: ${{ steps.set_priority_var.outputs.JIRA_PRIORITY_FIELD }}
with:
project: TKET
issuetype: Bug
summary: « [guppy] ${{ github.event.issue.title }}»
description: ${{ github.event.issue.html_url }}
fields: '{ "labels": ["guppy"] ${{ env.JIRA_PRIORITY_FIELD }} }'
- name: Create Task
uses: atlassian/[email protected]
if: ${{ ! contains(github.event.issue.labels.*.name, 'bug') }}
env:
JIRA_PRIORITY_FIELD: ${{ steps.set_priority_var.outputs.JIRA_PRIORITY_FIELD }}
with:
project: TKET
issuetype: Task
summary: « [guppy] ${{ github.event.issue.title }}»
description: ${{ github.event.issue.html_url }}
fields: '{ "labels": ["guppy"] ${{ env.JIRA_PRIORITY_FIELD }} }'