[KAN-17] 엔티티 구성 #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Jira issue | |
on: | |
issues: | |
types: | |
- opened | |
permissions: | |
contents: write | |
issues: write | |
jobs: | |
create-issue: | |
name: Create Jira issue | |
runs-on: ubuntu-latest | |
steps: | |
- name: 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: main branch를 checkout 한다 | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: 이슈를 파싱한다. | |
uses: stefanbuck/github-issue-praser@v3 | |
id: issue-parser | |
with: | |
template-path: .github/ISSUE_TEMPLATE/issue-form.yml | |
- name: 파싱한 이슈를 출력한다 | |
run: cat ${HOME}/issue-parser-result.json | |
- name: 파싱한 이슈(markdown)를 Jira format으로 변환한다 | |
uses: peter-evans/jira2md@v1 | |
id: md2jira | |
with: | |
input-text: | | |
${{ github.event.issue.body }} | |
### Github URL | |
- ${{ github.event.issue.html_url }} | |
mode: md2jira | |
- name: Jira Issue를 생성한다 | |
id: create | |
uses: atlassian/gajira-create@v3 | |
with: | |
project: KAN | |
issuetype: Task | |
summary: '${{ github.event.issue.title }}' | |
description: '${{ steps.md2jira.outputs.output-text }}' | |
- name: Jira Issue를 로깅한다 | |
run: echo "Issue ${{ steps.create.outputs.issue }} was created" | |
- name: develop branch를 체크아웃한다 | |
uses: actions/checkout@v4 | |
with: | |
ref: develop | |
- name: Issue에 해당하는 Branch를 Jira Issue 이름을 통해 재생성한다. | |
run: | | |
ISSUE_NUMBER="${{ steps.create.outputs.issue }}" | |
ISSUE_TITLE="${{ steps.issue-parser.outputs.issueparser_branch}}" | |
BRANCH_NAME="${ISSUE_NUMBER}-$(echo ${ISSUE_TITLE} | sed 's/ /-/g')" | |
git checkout -b "${BRANCH_NAME}" | |
git push origin "${BRANCH_NAME}" | |
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV # Set environment variable | |
- name: Issue 제목을 변경한다. (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 }}' | |
- name: 해당 Issue에 Jira와 Branch를 comment 한다. | |
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 }}) | |
Branch Name: ${{env.BRANCH_NAME}} | |