Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] /noti 워크플로우 수정 #13

Merged
merged 10 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/chore-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Chore Template"
about: 기타 이슈 템플릿
title: '[CHORE] '
labels: chore
assignees: ''

---

### ✨ Description


### ✨ Time(마감기한)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/docs-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Docs Template"
about: 문서화 이슈 템플릿
title: '[DOCS] '
labels: docs
assignees: ''

---

### ✨ Description


### ✨ Time(마감기한)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feat-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Feat Template"
about: 기능 추가 이슈 템플릿
title: "[FEAT] "
labels: feat
assignees: ''

---

### ✨ Description


### ✨ Time(마감기한)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/fix-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Fix Template"
about: 기능 수정 이슈 템플릿
title: "[FIX] "
labels: fix
assignees: ''

---

### ✨ Description


### ✨ Time(마감기한)
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/hotfix-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: "Hot-Fix Template"
about: 핫픽스 이슈 템플릿
title: "[HOTFIX] "
labels: hotfix
assignees: ''

---

### ✨ Description


### ✨ Time(마감기한)

- ASAP
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/issue-template.md

This file was deleted.

13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Refactor Template"
about: 리팩토링 이슈 템플릿
title: "[REFACTOR] "
labels: refactor
assignees: ''

---

### ✨ Description


### ✨ Time(마감기한)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/test-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Test Template"
about: 테스트 이슈 템플릿
title: "[TEST] "
labels: test
assignees: ''

---

### ✨ Description


### ✨ Time(마감기한)
15 changes: 15 additions & 0 deletions .github/workflows/Auto_Issue_Setting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Auto Issue Setting

on:
issues:
types: [opened]

jobs:
auto-assign:
runs-on: ubuntu-latest
steps:
- name: Auto-assign issue creator
uses: pozil/auto-assign-issue@v2
with:
repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
assignees: ${{ github.actor }}
49 changes: 38 additions & 11 deletions .github/workflows/PR_Comment_Notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,63 @@ name: Discord Notification on PR Comment
on:
issue_comment:
types: [ created, edited ]
pull_request_review:
types: [ submitted ]

jobs:
notify-discord:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/noti') }}
runs-on: ubuntu-latest

steps:
- name: Set Environment Variables
env:
TITLE: ${{ github.event.issue.title }}
run: |
echo "AVATAR_URL=${{ secrets.DISCORD_AVATAR_URL }}" >> $GITHUB_ENV
echo "COMMENT_BODY= 🤚백엔드 친구들 모여라~ 🔊" >> $GITHUB_ENV
echo "USERNAME=망나뇽" >> $GITHUB_ENV
echo "USERNAME=디코봇" >> $GITHUB_ENV
echo "WEB_HOOK=${{ secrets.DISCORD_WEB_HOOK }}" >> $GITHUB_ENV

- name: Set Environment Variables for PR Comments
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/noti') }}
run: |
echo "COMMENT_AUTHOR=${{ github.event.comment.user.login }}" >> $GITHUB_ENV
echo "PR_URL=${{ github.event.issue.pull_request.html_url }}" >> $GITHUB_ENV
echo "AUTHOR_URL=${{ github.event.comment.user.avatar_url }}" >> $GITHUB_ENV
echo "CONTENT=$(echo '${{ github.event.comment.body }}' | base64 -w 0)" >> $GITHUB_ENV
echo "COMMENT_BODY=${{ github.event.issue.title }}" >> $GITHUB_ENV

- name: Set Environment Variables for PR Review Comment
if: ${{ contains(github.event.review.body, '/noti') }}
run: |
echo "COMMENT_AUTHOR=${{ github.event.review.user.login }}" >> $GITHUB_ENV
echo "PR_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV
echo "AUTHOR_URL=${{ github.event.review.user.avatar_url }}" >> $GITHUB_ENV
echo "CONTENT=$(echo '${{ github.event.review.body }}' | base64 -w 0)" >> $GITHUB_ENV
echo "COMMENT_BODY=${{ github.event.pull_request.title }}" >> $GITHUB_ENV

- name: Set Environment Variables for Issue
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/noti') }}
run: |
echo "COMMENT_AUTHOR=${{ github.event.comment.user.login }}" >> $GITHUB_ENV
echo "PR_URL=${{ github.event.issue.html_url }}" >> $GITHUB_ENV
echo "AUTHOR_URL=${{ github.event.comment.user.avatar_url }}" >> $GITHUB_ENV
echo "CONTENT=$(echo '${{ github.event.comment.body }}' | base64 -w 0)" >> $GITHUB_ENV
echo "COMMENT_BODY=${{ github.event.issue.title }}" >> $GITHUB_ENV

- name: Notify Discord
if: ${{ env.COMMENT_AUTHOR && env.PR_URL && env.AUTHOR_URL && env.CONTENT && env.COMMENT_BODY }}
env:
COMMENT_BODY: ${{ env.COMMENT_BODY }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
PR_URL: ${{ github.event.issue.pull_request.html_url }}
AUTHOR_URL: ${{ github.event.comment.user.avatar_url }}
AVATAR_URL: ${{ env.AVATAR_URL }}
CONTENT: ${{ github.event.comment.body }}
COMMENT_BODY: ${{ env.COMMENT_BODY }}
USERNAME: ${{ env.USERNAME }}
WEB_HOOK: ${{ env.WEB_HOOK }}
COMMENT_AUTHOR: ${{ env.COMMENT_AUTHOR }}
PR_URL: ${{ env.PR_URL }}
AUTHOR_URL: ${{ env.AUTHOR_URL }}
CONTENT: ${{ env.CONTENT }}
run: |
CONTENT_DECODED=$(echo "$CONTENT" | base64 --decode)
if [ -n "$WEB_HOOK" ]; then
JSON_PAYLOAD=$(jq -n \
--arg content "$CONTENT" \
--arg content "$CONTENT_DECODED" \
--arg description "$COMMENT_BODY" \
--arg username "$USERNAME" \
--arg avatar_url "$AVATAR_URL" \
Expand Down
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
42 changes: 42 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
}

group = 'com'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'io.rest-assured:rest-assured:5.5.0'
}

tasks.named('test') {
useJUnitPlatform()
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading