- 예시에서는 칸반 템플릿을 선택했다.
키는 수정이 가능하지만, 예시에서는 지정해준대로 사용했다.
조금 기다리면 Get app 버튼이 Get Started로 바뀐다.
Name | Secret | |
---|---|---|
1 | JIRA_API_TOKEN | Jira에서 생성한 API 토큰 붙여넣기 |
2 | JIRA_BASE_URL | https://{본인 Jira 이름 입력}.atlassian.net |
3 | JIRA_USER_EMAIL | API 토큰을 생성한 이메일 |
- Jira와 연동할 GitHub 이슈 템플릿 경로 등을 설정하는 파일
name: Create Jira issue
on:
issues:
types:
- opened
jobs:
create-issue:
name: Create Jira issue
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
- name: Checkout main code
uses: actions/checkout@v4
with:
ref: dev
- name: Issue Parser
uses: stefanbuck/github-issue-praser@v3
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/issue_form.yml
- name: Log Issue Parser
run: |
echo '${{ steps.issue-parser.outputs.jsonString }}'
- name: Convert markdown to Jira Syntax
uses: peter-evans/jira2md@v1
id: md2jira
with:
input-text: |
### Github Issue Link
- ${{ github.event.issue.html_url }}
${{ github.event.issue.body }}
mode: md2jira
- name: Create Issue
id: create
uses: atlassian/gajira-create@v3
with:
project: TEST
issuetype: Sub-task
summary: "${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: |
{
"parent": {
"key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}"
}
}
- name: Log created issue
run: echo "Jira Issue ${{ steps.issue-parser.outputs.parentKey }}/${{ steps.create.outputs.issue }} was created"
- name: Checkout develop code
uses: actions/checkout@v4
with:
ref: dev
- name: Create branch with Ticket number
run: |
BRANCH_NAME="${{ steps.issue-parser.outputs.issueparser_branchPrefix }}/#${{ steps.issue-parser.outputs.issueparser_parentKey }}-${{ steps.issue-parser.outputs.issueparser_branchName }}"
git checkout -b "$BRANCH_NAME"
git push origin "$BRANCH_NAME"
- 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에서 이슈를 생성할 때 사용할 이슈 템플릿 파일
name: 'Test 이슈 생성'
description: 'Test Repo에 이슈를 생성하며, 생성된 이슈는 Jira와 연동됩니다.'
labels: [ order ]
title: '이슈 이름을 작성해주세요.'
body:
- type: input
id: parentKey
attributes:
label: '상위 작업 Ticket Number'
description: '상위 작업의 Ticket Number를 기입해주세요.'
placeholder: 'TEST-00'
validations:
required: true
- type: input
id: branchName
attributes:
label: '브랜치 이름 (이슈 요약)'
description: '영문 소문자로 브랜치 이름을 지어주세요. (ex: [도메인명]-[기능])'
validations:
required: true
- type: input
id: branchPrefix
attributes:
label: '브랜치 전략(GitFlow)'
description: 'feat/fix/docs/style/refactor/test/chore 중 해당 이슈와 걸맞게 작성해주세요.'
validations:
required: true
- type: textarea
id: details
attributes:
label: '상세 내용(Details)'
description: '이슈 내용을 자세히 설명해주세요.'
value: |
- 상세 내용에 대해 작성해주세요.
validations:
required: true
- type: textarea
id: tasks
attributes:
label: '체크리스트(Tasks)'
description: '해당 이슈에 대해 필요한 작업 목록을 작성해주세요.'
value: |
- [ ] Task1
- [ ] Task2
validations:
required: true
생성된 이슈 템플릿 Get started 클릭 후 양식에 맞춰 이슈 생성
Actions 확인
References