Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/ISSUE_TEMPLATE/-web1--이슈-생성-템플릿.md

This file was deleted.

34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-form.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "YAPP-Web-Team-1-FE 이슈 생성"
description: "YAPP-Web-Team-1-FE Front Repo에 이슈를 생성하며, 생성된 이슈는 Jira와 연동됩니다."
labels: [order]
title: "이슈 이름을 작성해주세요"
body:
- type: input
id: parentKey
attributes:
label: "🏷️ 상위 작업 (Ticket Number)"
description: "상위 작업의 Ticket Number를 기입해주세요"
placeholder: "PRODUCT-00"
validations:
required: true

- type: textarea
id: details
attributes:
label: "🚀 구현 내용"
description: "이슈에 대해서 자세히 설명해주세요"
value: |
- About Details
validations:
required: true

- type: textarea
id: tasks
attributes:
label: "✅ 할 일"
description: "해당 이슈에 대해 필요한 작업목록을 작성해주세요"
value: |
- [ ] Task1
- [ ] Task2
validations:
required: true
32 changes: 32 additions & 0 deletions .github/workflows/close-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Close Jira issue
on:
issues:
types:
- closed

jobs:
close-issue:
name: Close Jira issue
runs-on: ubuntu-latest

steps:
- name: Login to Jira
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: Extract Jira issue key from GitHub issue title
id: extract-key
run: |
ISSUE_TITLE="${{ github.event.issue.title }}"
JIRA_KEY=$(echo "$ISSUE_TITLE" | grep -oE '[A-Z]+-[0-9]+')
echo "JIRA_KEY=$JIRA_KEY" >> $GITHUB_ENV

- name: Close Jira issue
if: env.JIRA_KEY != ''
uses: atlassian/gajira-transition@v3
with:
issue: ${{ env.JIRA_KEY }}
transition: 완료
82 changes: 82 additions & 0 deletions .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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: main

- name: Issue Parser
uses: stefanbuck/github-issue-parser@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: PRODUCT
issuetype: 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: Create branch with Ticket number
run: |
ISSUE_NUMBER="${{ steps.create.outputs.issue }}"
BRANCH_NAME="feat/${ISSUE_NUMBER}"
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 }}"

- name: Add comment with Jira issue link
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: "Jira Issue Created: [${{ steps.create.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create.outputs.issue }})"