-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (92 loc) · 3.58 KB
/
notify.commit.yml
File metadata and controls
115 lines (92 loc) · 3.58 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Notify Commit
on:
push:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
type: ${{ steps.parse.outputs.type }}
detail: ${{ steps.parse.outputs.detail }}
tag: ${{ steps.parse.outputs.reaction }}
mode: ${{ steps.parse.outputs.mode }}
compose_weights: ${{ steps.parse.outputs.compose_weights }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# =========================
# 🔹 PARSE COMMIT
# =========================
- name: Parse Commit Message
id: parse
run: |
chmod +x .github/scripts/core/*.sh
chmod +x .github/scripts/agent/lib/*.sh
source .github/scripts/core/multiline.sh
source .github/scripts/core/commit.sh
source .github/scripts/core/mindset.sh
msg="${{ github.event.head_commit.message }}"
# 🔹 Call parser
parse_commit "$msg"
# 🔹 Get mode
mode=$(get_mode_by_commit)
type get_mode_by_commit
weights="{\"message,greeting\":20,\"greeting\":40,\"message\":40}"
echo "reaction=$REACTION" >> $GITHUB_OUTPUT
echo "type=$TYPE" >> $GITHUB_OUTPUT
echo "mode=$mode" >> $GITHUB_OUTPUT
set_multiline "detail" "$DETAIL"
echo "compose_weights=$weights" >> $GITHUB_OUTPUT
# =========================
# 🔹 NOTIFY (REUSABLE WORKFLOW)
# =========================
notify:
needs: prepare
uses: fridfn/workflow-development/.github/workflows/git.commit.message.yml@main
with:
private_message: |
📦 Repo: ${{ github.repository }}
👤 Author: ${{ github.actor }}
📝 Commit: ${{ github.event.head_commit.message }}
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
channel_message: |
# Commit Update
👤 Author : ${{ github.actor }}
🌿 Branch : ${{ github.ref_name }}
📦 Repo : ${{ github.repository }}
📝 Type : ${{ needs.prepare.outputs.type }}
📑 Info : ${{ needs.prepare.outputs.detail }}
🔗 Lihat Repo
https://github.com/${{ github.repository }}
🔗 Detail Commit
https://github.com/${{ github.repository }}/commit/${{ github.sha }}
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
secrets:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN_OWNER }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_CHANNEL_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
# =========================
# 🔹 AURIELLE AUTO REPLY
# =========================
aurielle_reply:
needs: [prepare, notify]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Run Aurielle Bot
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN_AURIELLE }}
TELEGRAM_CHANNEL_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
COMPOSE_WEIGHTS: ${{ needs.prepare.outputs.compose_weights }}
TYPE: ${{ needs.prepare.outputs.type }}
TAG: ${{ needs.prepare.outputs.tag }}
MODE: ${{ needs.prepare.outputs.mode }}
run: |
echo "[FLOW] Triggering Aurielle reply..."
echo "[FLOW] MODE=$MODE"
echo "[FLOW] TAG=$TAG"
echo "[FLOW] COMPOSE_WEIGHTS=$COMPOSE_WEIGHTS"
bash .github/scripts/agent/run.agent.sh