Skip to content

Commit 72bbdb8

Browse files
committed
Merge branch 'main' of https://github.com/front-studium/solveit into sujin
2 parents c64bcb1 + 88612d3 commit 72bbdb8

23 files changed

+164
-2
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111

1212
### Related Issues
1313

14+
<!--
1415
- [관련 이슈 번호, e.g., question #123]
1516
- 없으면 none
17+
-->
18+
19+
- none
1620

1721
### Checklist before creating a PR
1822

@@ -22,4 +26,3 @@
2226
- [ ] Projects에 solveit raodmap을 연동하고 Status를 Done으로 변경했나요?
2327
- [ ] Milestone에 해당 week을 연동했나요?
2428
- [ ] Development에 해당 week을 연동했나요?
25-
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Notify Discord on New Discussion
2+
3+
on:
4+
discussion:
5+
types: [created]
6+
7+
jobs:
8+
notify-discord:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Send Discussion info to Discord
12+
run: |
13+
MESSAGE="**새 Discussion이 시작됐습니다**\n\n💬 **제목**: ${{ github.event.discussion.title }}\n🙋‍♀️ **작성자**: ${{ github.event.discussion.user.login }}\n🔗 [바로가기](${{ github.event.discussion.html_url }})"
14+
15+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
16+
-H "Content-Type: application/json" \
17+
-H "Authorization: Bot ${{ secrets.REMINDER_BOT_TOKEN }}" \
18+
-d "{\"content\": \"$MESSAGE\"}" \
19+
https://discord.com/api/v10/channels/${{ secrets.DISCORD_CHANNEL_ID_SOLVEIT }}/messages)
20+
21+
echo "Discord Response Code: $RESPONSE"

.github/workflows/PR_Notifier.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Notify Discord on PR Created
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
jobs:
8+
notify-discord:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Send PR info to Discord
12+
env:
13+
PR_TITLE: ${{ github.event.pull_request.title }}
14+
PR_USER: ${{ github.event.pull_request.user.login }}
15+
PR_URL: ${{ github.event.pull_request.html_url }}
16+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_CHANNEL_ID_PR }}
17+
BOT_TOKEN: ${{ secrets.REMINDER_BOT_TOKEN }}
18+
run: |
19+
MESSAGE="**새 PR이 생성됐습니다**\n\n📌 **제목**: \`${PR_TITLE}\`\n🙋‍♀️ **작성자**: ${PR_USER}\n🔗 [PR 바로가기](${PR_URL})"
20+
21+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
22+
-H "Content-Type: application/json" \
23+
-H "Authorization: Bot ${BOT_TOKEN}" \
24+
-d "{\"content\": \"$MESSAGE\"}" \
25+
https://discord.com/api/v10/channels/${DISCORD_WEBHOOK}/messages)
26+
27+
echo "Discord Response Code: $RESPONSE"

.github/workflows/PR_Reminder.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PR Reminder
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 6" # 매주 토요일 9:00 (UTC 기준으로 토 00:00)
6+
workflow_dispatch:
7+
8+
jobs:
9+
send_message:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check environment variables
13+
run: |
14+
echo "DISCORD_CHANNEL_ID_PR=${{ secrets.DISCORD_CHANNEL_ID_PR}}"
15+
echo "REMINDER_BOT_TOKEN=${{ secrets.REMINDER_BOT_TOKEN }}"
16+
17+
- name: Notify PR Due Date
18+
run: |
19+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
20+
-H "Content-Type: application/json" \
21+
-H "Authorization: Bot ${{ secrets.REMINDER_BOT_TOKEN }}" \
22+
-d "{\"content\": \"오늘은 토요일~ PR 제출하는 날입니다. 잊지 말고 문제 푼 거 올려주세요~!\"}" \
23+
https://discord.com/api/v10/channels/${{ secrets.DISCORD_CHANNEL_ID_PR }}/messages)
24+
echo "Response: $RESPONSE"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Solveit Reminder
2+
3+
on:
4+
schedule:
5+
- cron: "0 4 * * 3" # 매주 수요일 13:00 (UTC 기준으로 04:00 AM)
6+
workflow_dispatch:
7+
8+
jobs:
9+
send_message:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check environment variables
13+
run: |
14+
echo "DISCORD_CHANNEL_ID_SOLVEIT=${{ secrets.DISCORD_CHANNEL_ID_SOLVEIT }}"
15+
echo "REMINDER_BOT_TOKEN=${{ secrets.REMINDER_BOT_TOKEN }}"
16+
17+
- name: Notify PR Due Date
18+
run: |
19+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
20+
-H "Content-Type: application/json" \
21+
-H "Authorization: Bot ${{ secrets.REMINDER_BOT_TOKEN }}" \
22+
-d "{\"content\": \"오늘 스터디 있어요~! 오후 4시에 Solveit에서 만나요~! \"}" \
23+
https://discord.com/api/v10/channels/${{ secrets.DISCORD_CHANNEL_ID_SOLVEIT }}/messages)
24+
echo "Response: $RESPONSE"

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
# .vscode/
2-
.vscode/
2+
.vscode/
3+
4+
# Node.js dependencies
5+
node_modules/
6+
7+
# Environment variables
8+
.env
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function solution(num1, num2) {
2+
if(typeof num1 !== 'number' || typeof num2 !== 'number') throw new Error ('입력한 값이 숫자가 아닙니다.');
3+
return Math.floor((num1 / num2) * 1000);
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function solution(num1, num2) {
2+
if(typeof num1 !== 'number' || typeof num2 !== 'number') throw new Error('입력 값이 숫자가 아닙니다.');
3+
return num1 + num2;
4+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function solution(n) {
2+
if (typeof n !== 'number') throw new Error('숫자를 입력해 주세요');
3+
const PIZZA_SLICE = 7;
4+
const result = Math.ceil( n / PIZZA_SLICE);
5+
6+
return result;
7+
}

0 commit comments

Comments
 (0)