Skip to content

VSXD-56 Issue 템플릿 작성 #8

VSXD-56 Issue 템플릿 작성

VSXD-56 Issue 템플릿 작성 #8

name: Create Jira issue
on:
issues:
types:
- opened
jobs:
create-issue:
name: Create Jira issue
permissions:
issues: write
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-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: VSXD
issuetype: Task
summary: "${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: |
${{ steps.issue-parser.outputs.issueparser_relatedKey != '' && format('{"parent": {"key": "{0}"}}', steps.issue-parser.outputs.issueparser_relatedKey ) || '{}' }}
- name: Log created issue
run: echo "Jira Issue ${{ steps.issue-parser.outputs.issueparser_relatedKey }}/${{ steps.create.outputs.issue }} was created"
- 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: Notify Slack
uses: slackapi/slack-github-action@v2.1.0
with:
method: chat.postMessage # Slack API 메서드 사용
token: ${{ secrets.SLACK_BOT_TOKEN }} # Bot 토큰 필요
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }} # 채널 ID
text: "📢 New Jira Issue Created: ${{ steps.create.outputs.issue }}"
blocks:
- type: section
text:
type: mrkdwn
text: |
*📢 New Jira Issue Created*
> *Jira Key*: <${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create.outputs.issue }}|${{ steps.create.outputs.issue }}>
> *Title*: ${{ github.event.issue.title }}
> *GitHub Issue*: <${{ github.event.issue.html_url }}|#${{ github.event.issue.number }}>
- type: actions
elements:
- type: button
text:
type: plain_text
text: View Jira Issue
url: "${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create.outputs.issue }}"