-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (93 loc) Β· 3.65 KB
/
github_with_jira.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Github with jira
on:
issues:
types: [opened]
jobs:
jira-login:
name: Jira Login
runs-on: ubuntu-latest
steps:
# githut secret νμ± -> github.actor μμ±μμ λ§κ² λ³ν
- name: Secrets Parsing
id: secret
run: |
echo "JIRA_API_TOKEN=JIRA_API_TOKEN_${{ github.actor }}" >> $GITHUB_OUTPUT
echo "JIRA_USER_EMAIL=JIRA_USER_EMAIL_${{ github.actor }}" >> $GITHUB_OUTPUT
# Jira Login
- name: Login
uses: atlassian/gajira-login@v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets[steps.secret.outputs.JIRA_API_TOKEN] }}
JIRA_USER_EMAIL: ${{ secrets[steps.secret.outputs.JIRA_USER_EMAIL] }}
# refμ λΈλμΉλ‘ μ΄λ
- name: Checkout develop code
uses: actions/checkout@v4
with:
ref: develop
# μμ±ν μ΄μ νμ±
- name: Issue Parser
uses: stefanbuck/github-issue-praser@v3
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/github_with_jira_issue.yml
# μμ±ν μ΄μ νμ± λ‘κ·Έ
- name: Log Issue Parser
run: echo '${{ steps.issue-parser.outputs.jsonString }}'
# λ§ν¬λ€μ΄ -> Jira λ³κ²½
- name: Convert markdown to Jira Syntax
uses: peter-evans/jira2md@v1
id: md2jira
with:
input-text: |
## Summary
${{ steps.issue-parser.outputs.issueparser_description }}
## Description
${{ steps.issue-parser.outputs.issueparser_details }}
## Reference
${{ steps.issue-parser.outputs.issueparser_references }}
## Github Issue Link
${{ github.event.issue.html_url }}
mode: md2jira
# Jira μ΄μ μμ± [ννΈ] μ΄μ νμ΄ν
- name: Create Issue
id: create
uses: atlassian/gajira-create@v3
with:
project: BVVER24
issuetype: κ°λ°
summary: "[Android] ${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: |
{
"parent": {
"key": "BVVER24-${{ steps.issue-parser.outputs.issueparser_parent }}"
}
}
# Jira μ΄μ μμ± λ‘κ·Έ
- name: Log created issue
run: echo "Issue ${{ steps.create.outputs.issue }} was created"
# Jira μ΄μ μμ±μ λ‘κ·Έ
- name: Log created issue
run: echo "Issue ${{ github.actor }} was created"
# Github μ΄μ νμ΄ν μμ "[μ΄μλ²νΈ] μ΄μνμ΄ν"
- name: Update issue title
uses: actions-cool/issues-helper@v3
with:
actions: "update-issue"
token: ${{ secrets.GITHUB_TOKEN }}
title: "[${{ steps.create.outputs.issue }}] ${{ github.event.issue.title }}"
# Github μ΄μ μκΈ° μμ Assignnes λ±λ‘
- name: Add assigness
uses: actions-cool/issues-helper@v3
with:
actions: 'add-assignees'
uses: actions-cool/issues-helper@v3
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
assignees: '${{ github.actor }}'
# λΈλμΉ μμ± -> "λΈλμΉνμ
"/"μ§λΌ μ΄μλ²νΈ"-"λΈλμΉ μ΄λ¦"
- name: Create branch with Ticket number
run: |
git checkout -b ${{ steps.issue-parser.outputs.issueparser_branchType }}/${{ steps.create.outputs.issue }}-${{ steps.issue-parser.outputs.issueparser_branchName }}
git push origin ${{ steps.issue-parser.outputs.issueparser_branchType }}/${{ steps.create.outputs.issue }}-${{ steps.issue-parser.outputs.issueparser_branchName }}