forked from transferwise/actions-pr-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefaults.sh
executable file
·92 lines (72 loc) · 1.86 KB
/
defaults.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
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
#!/bin/bash
if [[ -z "$GITHUB_TOKEN" ]]; then
echo "Set the GITHUB_TOKEN env variable."
exit 1
fi
if [[ -z "$GITHUB_REPOSITORY" ]]; then
echo "Set the GITHUB_REPOSITORY env variable."
exit 1
fi
if [[ -z "$GITHUB_EVENT_PATH" ]]; then
echo "Set the GITHUB_EVENT_PATH env variable."
exit 1
fi
if [[ -z "$GITHUB_EVENT_NAME" ]]; then
echo "Set the GITHUB_EVENT_NAME env variable."
exit 1
fi
#if [[ -z "$PULL_REQUEST_PATTERN" && -z "$ISSUE_PATTERN" ]]; then
# echo "Set either the PULL_REQUEST_PATTERN or the ISSUE_PATTERN env variables."
# exit 1
#fi
#if [[ ! -z "$PULL_REQUEST_PATTERN" && -z "$PR_COMMENT" ]]; then
# echo "Set the PR_COMMENT env variable."
# exit 1
#fi
#
#if [[ ! -z "$ISSUE_PATTERN" && -z "$ISSUE_COMMENT" ]]; then
# echo "Set the ISSUE_COMMENT env variable."
# exit 1
#fi
if [[ -z "$PR_CONTAINS_PATTERN" ]]; then
PR_CONTAINS_PATTERN=$PULL_REQUEST_PATTERN
fi
if [[ -z "$PR_CONTAINS_PATTERN" ]]; then
PR_CONTAINS_PATTERN=".*"
fi
if [[ -z "$PR_NOT_CONTAINS_PATTERN" ]]; then
PR_NOT_CONTAINS_PATTERN="pseudo-long-string-constant"
fi
if [[ -z "$PR_TITLE_CONTAINS_PATTERN" ]]; then
PR_TITLE_CONTAINS_PATTERN=".*"
fi
if [[ -z "$PR_TITLE_NOT_CONTAINS_PATTERN" ]]; then
PR_TITLE_NOT_CONTAINS_PATTERN="pseudo-long-string-constant"
fi
if [[ -z "$PR_TAGS_MANDATORY" ]]; then
PR_TAGS_MANDATORY=""
fi
if [[ -z "$PR_TAGS_MIN_COUNT" ]]; then
PR_TAGS_MIN_COUNT=0
fi
if [[ -z "$PR_TAGS_RESTRICTED" ]]; then
PR_TAGS_RESTRICTED=""
fi
if [[ -z "$PR_COMMENT" ]]; then
PR_COMMENT="Please check description. Should be meaningful and not empty."
fi
if [[ -z "$SUCCESS_EMOJI" ]]; then
SUCCESS_EMOJI="+1"
fi
if [[ -z "$SUCCESS_COMMENT" ]]; then
SUCCESS_COMMENT=""
fi
if [[ -z "$FAIL_CLOSES_PR" ]]; then
FAIL_CLOSES_PR=false
fi
if [[ -z "$FAIL_EXITS" ]]; then
FAIL_EXITS=true
fi
if [[ -z "$SUCCESS_APPROVES_PR" ]]; then
SUCCESS_APPROVES_PR=true
fi