-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 2.55 KB
/
Copy pathprogrammers-notify.yml
File metadata and controls
79 lines (70 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Programmers Commit Notify
on:
push:
branches:
- main
- master
# 매일 KST 20:50 = UTC 11:50
schedule:
- cron: '50 11 * * *'
jobs:
# ── 목표 미달성 리마인더 (매일 밤 11시 KST) ──────────────
reminder:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run Reminder Script
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
# 멘션할 Discord User ID (스페이스로 구분해서 여러 명 가능)
DISCORD_USER_IDS: ${{ secrets.DISCORD_USER_IDS }}
run: node scripts/reminder.js
# ── 커밋 알림 (push 시) ───────────────────────────────────
notify-discord:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Restore streak cache
uses: actions/cache@v4
with:
path: .streak-cache
key: streak-data-${{ github.repository_owner }}
restore-keys: |
streak-data-
- name: Run Discord Notify Script
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
COMMIT_SHA: ${{ github.sha }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMITTER_NAME: ${{ github.event.head_commit.author.name }}
COMMITTER_USERNAME: ${{ github.actor }}
REPO_NAME: ${{ github.repository }}
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
COMMITS_JSON: ${{ toJson(github.event.commits) }}
STREAK_CACHE_DIR: .streak-cache
run: node scripts/notify.js
- name: Save streak cache
if: always()
uses: actions/cache/save@v4
with:
path: .streak-cache
key: streak-data-${{ github.repository_owner }}-${{ github.run_id }}