Skip to content

Commit

Permalink
chore: 이슈 템플릿 수정 (#52)
Browse files Browse the repository at this point in the history
* chore: 이슈 템플릿 수정

* fix: 브랜치명 컨벤션 반영하여 수정
  • Loading branch information
juheehasaeyo authored Feb 13, 2025
1 parent 26da7b1 commit f047f7c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 85 deletions.
63 changes: 25 additions & 38 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,47 @@
name: 'Feat'
description: 'feat 작업 시 입력해주세요.'
name: "Feat"
description: "feat 작업 시 입력해주세요."
labels: [feat]
title: 'feat: '
title: "feat: "
body:
- type: input
id: branch
attributes:
label: '브랜치 이름(Branch Name)'
description: '생성할 브랜치 이름을 작성해주세요.'
placeholder: 'chat-implement'
label: "브랜치 이름은 무엇인가요?"
description: "브랜치 생성을 원치 않으면 비워두세요."
placeholder: "feat/#11-chatting"
validations:
required: true

required: false
- type: input
id: description
attributes:
label: '이슈 내용(Description)'
description: '기능에 대해서 간략히 설명해주세요.'
validations:
required: true

- type: input
id: start_date
attributes:
label: '시작 날짜(Start Date)'
description: '시작 날짜를 YYYY-MM-DD 형식으로 입력해주세요.'
placeholder: '2024-01-01'
validations:
required: true

- type: input
id: due_date
attributes:
label: '기한(Due Date)'
description: '기한을 YYYY-MM-DD 형식으로 입력해주세요.'
placeholder: '2024-12-31'
label: "작업할 내용은 무엇인가요?"
description: "기능에 대해 간략히 설명해주세요."
validations:
required: true

- type: textarea
id: tasks
attributes:
label: '체크리스트(Tasks)'
description: '해당 이슈에 대해 필요한 작업목록을 작성해주세요.'
label: "할 일은 무엇인가요?"
description: "해당 이슈에 대해 필요한 작업목록을 작성해주세요."
value: |
- [ ] Task1
- [ ] Task2
- [ ]
validations:
required: true

- type: textarea
id: references
- type: checkboxes
id: without_jira_issue
attributes:
label: '참조(References)'
description: '해당 이슈과 관련된 레퍼런스를 참조해주세요.'
value: |
- Reference1
label: "지라 이슈를 제외할까요?"
description: "체크하면 지라 이슈와 티켓 넘버가 생성되지 않아요."
options:
- label: 지라 이슈를 만들지 않을래요

- type: input
id: due_date
attributes:
label: "개발 기한은 언제인가요?"
description: "비워두시면 다음날로 저장할게요."
placeholder: "YYYY-MM-DD"
validations:
required: false
7 changes: 4 additions & 3 deletions .github/workflows/close_jira_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ jobs:

- name: Extract Jira issue key from GitHub issue title
id: extract-key
run: |
run: |
ISSUE_TITLE="${{ github.event.issue.title }}"
JIRA_KEY=$(echo "$ISSUE_TITLE" | grep -oE '[A-Z]+-[0-9]+')
ISSUE_NUM=$(echo "$ISSUE_TITLE" | grep -oE '[0-9]+$' || true)
JIRA_KEY="TINU-$ISSUE_NUM"
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: ISSUE-CLOSE
transition: ISSUE-CLOSE
75 changes: 33 additions & 42 deletions .github/workflows/create_jira_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@ jobs:
template-path: .github/ISSUE_TEMPLATE/feature.yml

- name: Log Issue Parser
id: date
run: |
echo '${{ steps.issue-parser.outputs.jsonString }}'
echo "Branch Name : ${{ steps.issue-parser.outputs.issueparser_branch }}"
echo "Start date : ${{ steps.issue-parser.outputs.issueparser_start_date }}"
echo "Due date : ${{ steps.issue-parser.outputs.issueparser_due_date }}"
echo "checkbox : ${{ steps.issue-parser.outputs.issueparser_without_jira_issue }}"
echo "DUE_DATE : ${{ steps.issue-parser.outputs.issueparser_due_date }}"
echo "START_DATE=$(date +%F)" >> $GITHUB_OUTPUT
echo "START_DATE : ${{ steps.date.outputs.START_DATE }}"
if [[ "${{ steps.issue-parser.outputs.issueparser_due_date }}" == "" ]]; then
echo "DUE_DATE=$(date -d '1 days' +%F)" >> $GITHUB_OUTPUT
else
echo "DUE_DATE=${{ steps.issue-parser.outputs.issueparser_due_date }}" >> $GITHUB_OUTPUT
fi
echo "DUE_DATE : ${{ steps.date.outputs.DUE_DATE }}"
- name: Convert markdown to Jira Syntax
if: ${{ steps.issue-parser.outputs.issueparser_without_jira_issue != '지라 이슈를 만들지 않을래요' }}
uses: peter-evans/jira2md@v1
id: md2jira
with:
Expand All @@ -43,65 +53,46 @@ jobs:
${{ github.event.issue.body }}
mode: md2jira

- name: Check JIRA_USER_EMAIL
run: |
if [ -z "${{ secrets.JIRA_USER_EMAIL }}" ]; then
echo "JIRA_USER_EMAIL is not set or empty"
else
echo "JIRA_USER_EMAIL is set"
fi

- name: Check JIRA_API_TOKEN
run: |
if [ -z "${{ secrets.JIRA_API_TOKEN }}" ]; then
echo "JIRA_API_TOKEN is not set or empty"
else
echo "JIRA_API_TOKEN is set"
fi
- name: Check JIRA_BASE_URL
run: |
if [ -z "${{ secrets.JIRA_BASE_URL }}" ]; then
echo "JIRA_BASE_URL is not set or empty"
else
echo "JIRA_BASE_URL is set"
fi
- name: List Jira Fields
run: |
curl -u ${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }} \
-X GET \
-H "Content-Type: application/json" \
"${{ secrets.JIRA_BASE_URL }}/rest/api/2/field"
- name: Create Issue
if: ${{ steps.issue-parser.outputs.issueparser_without_jira_issue != '지라 이슈를 만들지 않을래요' }}
id: create
uses: atlassian/gajira-create@v3
with:
project: TINU
issuetype: CLIENT
summary: "${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: '{"parent": { "key": "TINU-49" }, "customfield_10015": "${{ steps.issue-parser.outputs.issueparser_start_date }}", "duedate": "${{ steps.issue-parser.outputs.issueparser_due_date }}"}'
fields: '{"parent": { "key": "TINU-49" }, "customfield_10015": "${{ steps.date.outputs.START_DATE }}", "duedate": "${{ steps.date.outputs.DUE_DATE }}"}'

- 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: main
if: ${{ steps.issue-parser.outputs.issueparser_without_jira_issue != '지라 이슈를 만들지 않을래요' }}
id: issue-num
run: |
echo "Jira Issue ${{ steps.issue-parser.outputs.parentKey }}/${{ steps.create.outputs.issue }} was created"
FULL_ISSUE="${{ steps.create.outputs.issue }}"
ISSUE_NUM=$(echo "$FULL_ISSUE" | sed 's/.*-//')
echo "ISSUE_NUM=$ISSUE_NUM" >> $GITHUB_ENV
echo "Extracted ISSUE_NUM is: $ISSUE_NUM"
- name: Create branch with Ticket number
if: ${{ steps.issue-parser.outputs.issueparser_branch != '' }}
run: |
BRANCH_NAME="${{ steps.create.outputs.issue }}/${{ steps.issue-parser.outputs.issueparser_branch }}"
WITHOUT_JIRA="${{ steps.issue-parser.outputs.issueparser_without_jira_issue }}"
if [[ "$WITHOUT_JIRA" == "지라 이슈를 만들지 않을래요" ]]; then
BRANCH_NAME="${{ steps.issue-parser.outputs.issueparser_branch }}"
else
BRANCH_NAME="${{ steps.create.outputs.issue }}/${{ steps.issue-parser.outputs.issueparser_branch }}"
fi
git checkout -b $BRANCH_NAME
git push origin $BRANCH_NAME
- name: Update issue title
if: ${{ steps.issue-parser.outputs.issueparser_without_jira_issue != '지라 이슈를 만들지 않을래요' }}
uses: actions-cool/issues-helper@v3
with:
actions: "update-issue"
token: ${{ secrets.GITHUB_TOKEN }}
title: "${{ steps.create.outputs.issue }} ${{ github.event.issue.title }}"
title: "${{ github.event.issue.title }} - ${{ env.ISSUE_NUM }} "
5 changes: 3 additions & 2 deletions .github/workflows/reopen_jira_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
id: extract-key
run: |
ISSUE_TITLE="${{ github.event.issue.title }}"
JIRA_KEY=$(echo "$ISSUE_TITLE" | grep -oE '[A-Z]+-[0-9]+')
ISSUE_NUM=$(echo "$ISSUE_TITLE" | grep -oE '[0-9]+$' || true)
JIRA_KEY="TINU-$ISSUE_NUM"
echo "JIRA_KEY=$JIRA_KEY" >> $GITHUB_ENV
- name: Reopen Jira issue
if: env.JIRA_KEY != ''
uses: atlassian/gajira-transition@v3
with:
issue: ${{ env.JIRA_KEY }}
transition: ISSUE-REOPEN
transition: ISSUE-REOPEN

0 comments on commit f047f7c

Please sign in to comment.