forked from sahyam2019/oub-remix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
telegram
41 lines (38 loc) · 1.08 KB
/
telegram
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
#!/usr/bin/env dash
# shellcheck source=/dev/null
#
# Copyright (C) 2020 Raphielscape LLC.
#
# Licensed under the Raphielscape Public License, Version 1.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Telegram command container
TELEGRAM=$SEMAPHORE_PROJECT_DIR/init/telegramapi
export TELEGRAM
# Caster configurations
MAINGROUP_ID="-1001460242671"
# sendcast to group
tg_sendinfo() {
"${TELEGRAM}" -c ${MAINGROUP_ID} -H \
"$(
for POST in "${@}"; do
echo "${POST}"
done
)" \
-t $BOT_API_KEY
}
kickstart_pub() {
if [ ! -z "$PULL_REQUEST_NUMBER" ]; then
tg_sendinfo "I am starting build" \
"PR: <code>${PULL_REQUEST_NUMBER}</code>" \
"Commit Point <code>${COMMIT_POINT}</code>" \
" " \
"<b>Github Link: </b> https://github.com/sahyam2019/oub-remix/commit/${COMMIT_HASH}"
else
tg_sendinfo "I am starting build" \
"Branch <code>${PARSE_BRANCH}</code>" \
"Commit Point <code>${COMMIT_POINT}</code>" \
" " \
"<b>Github Link: </b> https://github.com/sahyam2019/oub-remix/commit/${COMMIT_HASH}"
fi
}