Skip to content

Commit

Permalink
Merge pull request #7 from YAPP-Github/chore/TNT-69
Browse files Browse the repository at this point in the history
[TNT-69] ν˜‘μ—…νˆ΄ μ„ΈνŒ…
  • Loading branch information
hoyahozz authored Jan 4, 2025
2 parents b81a5ef + 8b0d012 commit 656dd5c
Show file tree
Hide file tree
Showing 12 changed files with 499 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-form.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: '이슈 생성'
description: '이슈λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€. μƒμ„±λœ μ΄μŠˆλŠ” Jira task 둜 μžλ™ μƒμ„±λ©λ‹ˆλ‹€.'
labels: [order]
title: '이슈λͺ…을 μž…λ ₯ν•΄μ£Όμ„Έμš”.'
body:
- type: input
id: parentKey
attributes:
label: 'Epic/Story Ticket Number'
description: 'Ticket Numberλ₯Ό κΈ°μž…ν•΄μ£Όμ„Έμš”.'
placeholder: 'TNT-00'
validations:
required: true

- type: input
id: description
attributes:
label: '이슈 λ‚΄μš©'
description: 'μ΄μŠˆμ— λŒ€ν•΄ κ°„λž΅ν•˜κ²Œ μ„€λͺ…ν•΄μ£Όμ„Έμš”.'
validations:
required: true

- type: textarea
id: tasks
attributes:
label: '체크리슀트(Tasks)'
description: 'ν•΄λ‹Ή μ΄μŠˆμ™€ μ—°κ΄€λœ μž‘μ—… λͺ©λ‘μ„ μž‘μ„±ν•΄μ£Όμ„Έμš”'
value: |
- [ ] Task1
- [ ] Task2
validations:
required: false
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## πŸ“ μž‘μ—… λ‚΄μš©

- Closes #



## πŸ“Έ μ‹€ν–‰ ν™”λ©΄




## πŸ™†πŸ» 리뷰 μš”μ²­ 사항



## πŸ‘€ 레퍼런슀

15 changes: 15 additions & 0 deletions .github/workflows/auto-assign.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Auto Assign'
on:
pull_request:
types: [opened, ready_for_review]

jobs:
add-reviews:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: kentaro-m/[email protected]
with:
configuration-path: .github/workflows/auto_assign.yaml
31 changes: 31 additions & 0 deletions .github/workflows/close-jira-issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Close Jira issue
on:
issues:
types:
- closed

jobs:
close-issue:
name: Close Jira issue
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: Find in Jira ticket
id: jira-ticket
run: |
ISSUE_TITLE="${{ github.event.issue.title }}"
JIRA_KEY=$(echo "$ISSUE_TITLE" | grep -oE '[A-Z]+-[0-9]+')
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: μ™„λ£Œ
107 changes: 107 additions & 0 deletions .github/workflows/create-jira-issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Create Jira issue
on:
issues:
types:
- opened

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" == "hoyahozz" ]; then
echo "::set-output name=accountId::${{ secrets.HOYAHOZZ_ACCOUNT_ID }}"
else
echo "::set-output name=accountId::${{ secrets.SEONJEONGK_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/issue-form.yaml

- 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: TNT
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: TNT
issuetype: Task
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: 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 }}"

- name: Add comment with Jira issue link
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.ACCESS_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 }})'

37 changes: 37 additions & 0 deletions .github/workflows/opened-issue-noti.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Opened Issue Notification
on:
issues:
types:
- opened

jobs:
create-issue:
name: Discord notification
runs-on: ubuntu-latest
steps:
- name: Send Issue
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: μ™€ν”Œκ³° BOT
DISCORD_AVATAR: https://github.com/user-attachments/assets/4f1d10bc-f782-42ef-af63-fba0f51907c5
DISCORD_EMBEDS: |
[
{
"title": "μƒˆλ‘œμš΄ μ΄μŠˆκ°€ λ“±λ‘λ˜μ—ˆμŠ΅λ‹ˆλ ! 🎊\n${{ github.event.issue.title }}",
"color": 10478271,
"description": "${{ github.event.issue.html_url }}",
"fields": [
{
"name": "Issue Number",
"value": "#${{ github.event.issue.number }}",
"inline": true
},
{
"name": "Author",
"value": "${{ github.event.issue.user.login }}",
"inline": true
}
]
}
]
42 changes: 42 additions & 0 deletions .github/workflows/opened-pr-noti.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Opened PR Notification
on:
pull_request:
types:
- opened

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Send notification
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: μ™€ν”Œκ³° BOT
DISCORD_AVATAR: https://github.com/user-attachments/assets/4f1d10bc-f782-42ef-af63-fba0f51907c5
DISCORD_EMBEDS: |
[
{
"author": {
"name": "${{ github.event.pull_request.user.login }}",
"url": "https://github.com/user-attachments/assets/2e1aadea-149e-4bef-ab67-1c6c6b8c21cd",
"icon_url": "${{ github.event.pull_request.user.avatar_url }}"
},
"title": "μ‹ κ·œ PR이 λ“±λ‘λ˜μ—ˆμŠ΅λ‹ˆλ ! 24μ‹œκ°„λ‚΄λ‘œ λ¦¬λ·°ν•΄μ£Όμ„Έμš”! πŸ₯³\n#${{ github.event.pull_request.number }} : ${{ github.event.pull_request.title }}",
"color": 10478271,
"description": "${{ github.event.pull_request.html_url }}",
"fields": [
{
"name": "Base Branch",
"value": "${{ github.base_ref }}",
"inline": true
},
{
"name": "Compare Branch",
"value": "${{ github.head_ref }}",
"inline": true
}
]
}
]
107 changes: 107 additions & 0 deletions .github/workflows/pr-review-noti.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
on:
pull_request_review:
types: [submitted]

jobs:
approved:
if: github.event.review.state == 'APPROVED'
runs-on: ubuntu-latest
steps:
- name: Send Approve Message
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: μ™€ν”Œκ³° BOT
DISCORD_AVATAR: https://github.com/user-attachments/assets/4f1d10bc-f782-42ef-af63-fba0f51907c5
DISCORD_EMBEDS: |
[
{
"title": "PR이 μŠΉμΈλ˜μ—ˆμŠ΅λ‹ˆλ ! λ¨Έμ§€ν•΄μ£Όμ„Έμš” ~! πŸ₯³\n${{ github.event.pull_request.title }}",
"color": 10478271,
"description": "${{ github.event.review.html_url }}",
"fields": [
{
"name": "Reviewer",
"value": "${{ github.event.review.user.login }}",
"inline": true
},
{
"name": "Comment",
"value": "${{ github.event.review.body }}",
"inline": true
},
{
"name": "State",
"value": "${{ github.event.review.state }}",
"inline": true
}
]
}
]
changes_requested:
if: github.event.review.state == 'changes_requested'
runs-on: ubuntu-latest
steps:
- name: Send Comment Message
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: μ™€ν”Œκ³° BOT
DISCORD_AVATAR: https://github.com/user-attachments/assets/4f1d10bc-f782-42ef-af63-fba0f51907c5
DISCORD_EMBEDS: |
[
{
"title": "PR에 λŒ€ν•œ μˆ˜μ • μš”μ²­μ΄ λ“€μ–΄μ™”μŠ΅λ‹ˆλ . ν™•μΈν•΄μ£Όμ„Έμš”! ⚠️\n${{ github.event.pull_request.title }}",
"color": 13458524,
"description": "${{ github.event.review.html_url }}",
"fields": [
{
"name": "Reviewer",
"value": "${{ github.event.review.user.login }}",
"inline": true
},
{
"name": "Comment",
"value": "${{ github.event.review.body }}",
"inline": true
},
{
"name": "State",
"value": "${{ github.event.review.state }}",
"inline": true
}
]
}
]
commented:
if: github.event.review.state == 'commented'
runs-on: ubuntu-latest
steps:
- name: Send Comment Message
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: μ™€ν”Œκ³° BOT
DISCORD_AVATAR: https://github.com/user-attachments/assets/4f1d10bc-f782-42ef-af63-fba0f51907c5
DISCORD_EMBEDS: |
[
{
"title": "PR에 λŒ€ν•œ μ½”λ©˜νŠΈκ°€ λ“±λ‘λ˜μ—ˆμŠ΅λ‹ˆλ ! ν™•μΈν•΄μ£Όμ„Έμš”! βœ…\n${{ github.event.pull_request.title }}",
"color": 16187019,
"description": "${{ github.event.review.html_url }}",
"fields": [
{
"name": "Reviewer",
"value": "${{ github.event.review.user.login }}",
"inline": true
},
{
"name": "State",
"value": "${{ github.event.review.state }}",
"inline": true
}
]
}
]
Loading

0 comments on commit 656dd5c

Please sign in to comment.