Skip to content

Commit

Permalink
fix: Jira 연동 워크플로우 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
ywonchae1 committed Nov 12, 2024
1 parent 82ba675 commit c4b886f
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 147 deletions.
57 changes: 1 addition & 56 deletions .github/workflows/close-issue.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 이슈 닫기 연결 자동화
name: 프로젝트 이슈 닫기 연결 자동화
on:
issues:
types:
Expand All @@ -8,61 +8,6 @@ jobs:
close-jira-issue:
permissions: write-all

name: Jira 이슈 닫기
runs-on: ubuntu-latest
steps:
- name: 원채 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'ywonchae1'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_WONCHAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_WONCHAE_USER_EMAIL }}

- name: 유진 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'sseoU'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_YOUJIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_YOUJIN_USER_EMAIL }}

- name: 민석 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'seok019283501'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_MINSEOK_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_MINSEOK_USER_EMAIL }}

- name: 경재 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'bestKUFO'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_KYONGJAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_KYONGJAE_USER_EMAIL }}

- name: 지인 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'OziinG'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_JIIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_JIIN_USER_EMAIL }}

- name: Jira 이슈 키 찾기
id: issue-key
uses: atlassian/gajira-find-issue-key@master
with:
string: ${{ github.event.issue.title }}

- name: Jira 이슈 완료로 이동
uses: atlassian/gajira-transition@v3
with:
issue: ${{ steps.issue-key.outputs.issue }}
transitionId: 31

close-project-issue:
permissions: write-all

Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/close-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Jira 이슈 닫기 연결 자동화
on:
issues:
types:
- closed

jobs:
close-jira-issue:
permissions: write-all

name: Jira 이슈 닫기
runs-on: ubuntu-latest
steps:
- name: 원채 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'ywonchae1'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_WONCHAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_WONCHAE_USER_EMAIL }}

- name: 유진 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'sseoU'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_YOUJIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_YOUJIN_USER_EMAIL }}

- name: 민석 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'seok019283501'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_MINSEOK_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_MINSEOK_USER_EMAIL }}

- name: 경재 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'bestKUFO'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_KYONGJAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_KYONGJAE_USER_EMAIL }}

- name: 지인 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'OziinG'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_JIIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_JIIN_USER_EMAIL }}

- name: Jira 이슈 키 찾기
id: issue-key
uses: atlassian/gajira-find-issue-key@master
with:
string: ${{ github.event.issue.title }}

- name: Jira 이슈 완료로 이동
uses: atlassian/gajira-transition@v3
with:
issue: ${{ steps.issue-key.outputs.issue }}
transitionId: 31
91 changes: 0 additions & 91 deletions .github/workflows/create-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,97 +8,6 @@ jobs:
create-jira-issue:
permissions: write-all

name: Jira 이슈 생성
runs-on: ubuntu-latest
steps:
- name: 이슈 담당자 자동 할당
uses: pozil/auto-assign-issue@v2
with:
assignees: ${{ github.actor }}

- name: 원채 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'ywonchae1'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_WONCHAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_WONCHAE_USER_EMAIL }}

- name: 유진 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'sseoU'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_YOUJIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_YOUJIN_USER_EMAIL }}

- name: 민석 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'seok019283501'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_MINSEOK_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_MINSEOK_USER_EMAIL }}

- name: 경재 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'bestKUFO'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_KYONGJAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_KYONGJAE_USER_EMAIL }}

- name: 지인 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'OziinG'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_JIIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_JIIN_USER_EMAIL }}

- name: Main 브랜치 체크아웃
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/2-feature-issue-form.yml'

- name: 이슈 Markdown 문법을 Jira 문법으로 변환
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: Jira에 이슈 생성
id: create
uses: atlassian/gajira-create@v3
with:
project: KAN
issuetype: Task
summary: "${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: |
{
"parent": {
"key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}"
}
}
- name: 이슈 제목 수정
uses: actions-cool/issues-helper@v3
with:
actions: "update-issue"
title: "${{ steps.create.outputs.issue }} ${{ github.event.issue.title }}"

create-project-issue:
permissions: write-all

Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Jira 이슈 생성 연결 자동화
on:
issues:
types:
- opened

jobs:
create-jira-issue:
permissions: write-all

name: Jira 이슈 생성
runs-on: ubuntu-latest
steps:
- name: 이슈 담당자 자동 할당
uses: pozil/auto-assign-issue@v2
with:
assignees: ${{ github.actor }}

- name: 원채 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'ywonchae1'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_WONCHAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_WONCHAE_USER_EMAIL }}

- name: 유진 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'sseoU'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_YOUJIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_YOUJIN_USER_EMAIL }}

- name: 민석 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'seok019283501'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_MINSEOK_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_MINSEOK_USER_EMAIL }}

- name: 경재 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'bestKUFO'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_KYONGJAE_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_KYONGJAE_USER_EMAIL }}

- name: 지인 Jira 로그인
uses: atlassian/gajira-login@v3
if: github.actor == 'OziinG'
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_JIIN_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_JIIN_USER_EMAIL }}

- name: Main 브랜치 체크아웃
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/2-feature-issue-form.yml'

- name: 이슈 Markdown 문법을 Jira 문법으로 변환
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: Jira에 이슈 생성
id: create
uses: atlassian/gajira-create@v3
with:
project: KAN
issuetype: Task
summary: "${{ github.event.issue.title }}"
description: "${{ steps.md2jira.outputs.output-text }}"
fields: |
{
"parent": {
"key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}"
}
}
- name: 이슈 제목 수정
uses: actions-cool/issues-helper@v3
with:
actions: "update-issue"
title: "${{ steps.create.outputs.issue }} ${{ github.event.issue.title }}"

0 comments on commit c4b886f

Please sign in to comment.