-
Notifications
You must be signed in to change notification settings - Fork 9
/
entrypoint.sh
executable file
·49 lines (39 loc) · 928 Bytes
/
entrypoint.sh
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
#!/usr/bin/env bash
ROOT="$(dirname "${BASH_SOURCE}")"
ROOT="$(realpath -m ${ROOT})"
PATH="${ROOT}/bin:${PATH}"
function check_args() {
if [[ "${LOGIN}" == "" ]]; then
echo "No login specified"
exit 1
fi
if [[ "${ISSUE_KIND}" == "" ]]; then
echo "No issue kind specified"
exit 1
fi
if [[ "${ISSUE_NUMBER}" == "" ]]; then
echo "No issue number specified"
exit 1
fi
if [[ "${GH_REPOSITORY}" == "" ]]; then
echo "No repository specified"
exit 1
fi
if [[ "${TYPE}" == "" ]]; then
echo "No type"
exit 1
fi
}
function main() {
if [[ "${TYPE}" == "created" ]]; then
echo "Greetings to ${LOGIN}!"
greeting.sh
echo "Response to action"
response.sh
elif [[ "${TYPE}" == "comment" ]]; then
echo "Response to action"
response.sh
fi
}
check_args
main