Skip to content

[refactor]: 알림에 userId를 포함시킨다. #66

[refactor]: 알림에 userId를 포함시킨다.

[refactor]: 알림에 userId를 포함시킨다. #66

name: Create Jira issue
on:
issues:
types:
- opened
- reopened
jobs:
create-issue:
name: Create Jira issue
runs-on: ubuntu-latest
steps:
- name: Checkout develop code
uses: actions/checkout@v4
with:
ref: develop
- name: Get Jira Assignee From PR Author
id: jira-assignee
run: |
AUTHOR=${{ github.event.issue.user.login }}
if [ "$AUTHOR" == "sectionr0" ]; then
echo "::set-output name=accountId::${{ secrets.MANGO_ACCOUNT_ID }}"
else
echo "::set-output name=accountId::${{ secrets.MATTHEW_ACCOUNT_ID }}"
fi
- 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: Issue Parser
uses: stefanbuck/github-issue-praser@v3
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/feature_request.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 SubTask
id: create-subtask
uses: atlassian/gajira-create@v3
with:
project: WS
issuetype: SubTask
summary: "${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: |
{
"parent": {
"key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}"
},
"assignee" : {
"id" : "${{ steps.jira-assignee.outputs.accountId }}"
}
}
- name: Create Issue
id: create-issue
if: failure()
uses: atlassian/gajira-create@v3
with:
project: WS
issuetype: Server
summary: "${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: |
{
"parent": {
"key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}"
},
"assignee" : {
"id" : "${{ steps.jira-assignee.outputs.accountId }}"
}
}
- name: Log created issue
run: echo "Jira Issue ${{ steps.issue-parser.outputs.parentKey }}/${{ steps.create.outputs.issue }} was created"
- name: Update issue title
if: always() && (steps.create-subtask.conclusion == 'success' || steps.create-issue.conclusion == 'success')
uses: actions-cool/issues-helper@v3
with:
actions: "update-issue"
token: ${{ secrets.ACCESS_GITHUB_TOKEN }}
title: "${{ steps.create-subtask.outputs.issue || steps.create-issue.outputs.issue }} ${{ github.event.issue.title }}"