File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -270,11 +270,23 @@ function block_emails() {
270
270
271
271
hosts_block_email=$( shyaml get-value " $GITHUB_BRANCH .block_emails" < " $hosts_file " 2> /dev/null || exit 0)
272
272
273
+ # priority: hosts.yml > workflow
273
274
if [[ -n " $hosts_block_email " ]]; then
274
- BLOCK_EMAILS=" $hosts_block_email "
275
+
276
+ match_hosts_block_email=$( echo " $hosts_block_email " | awk ' {$1=$1;print tolower($0)}' )
277
+
278
+ if [[ " ${match_hosts_block_email} " == ' true' ]]; then
279
+ BLOCK_EMAILS=" $hosts_block_email "
280
+ else
281
+ BLOCK_EMAILS=' '
282
+ fi
275
283
fi
276
284
277
285
if [[ -n " $BLOCK_EMAILS " ]]; then
286
+ MATCH_BLOCK_EMAIL=$( echo " $BLOCK_EMAILS " | awk ' {$1=$1;print tolower($0)}' )
287
+ fi
288
+
289
+ if [[ " $MATCH_BLOCK_EMAIL " == ' true' ]]; then
278
290
279
291
# priority: 1. hosts.yml 2. vip 3. WP
280
292
echo -e " \033[34mSETUP EMAIL BLOCKING\033[0m"
You can’t perform that action at this time.
0 commit comments