2022-10-28 00:02:42 +02:00
|
|
|
# shellcheck shell=bash
|
|
|
|
|
|
2020-08-21 19:06:43 -07:00
|
|
|
# $1 - start or end
|
|
|
|
|
# $2 - fold identifier, no spaces
|
|
|
|
|
# $3 - fold section description
|
2022-07-11 14:43:25 -07:00
|
|
|
foldable() {
|
2021-06-14 11:16:46 -07:00
|
|
|
local YELLOW='\033[1;33m'
|
|
|
|
|
local NOCOLOR='\033[0m'
|
2022-07-13 10:42:50 -07:00
|
|
|
if [ $1 = "start" ]; then
|
|
|
|
|
line="::group::$2"
|
2021-06-14 11:16:46 -07:00
|
|
|
if [ ! -z "${3:-}" ]; then
|
2022-07-13 10:42:50 -07:00
|
|
|
line="$line - ${YELLOW}$3${NOCOLOR}"
|
2021-06-14 11:16:46 -07:00
|
|
|
fi
|
|
|
|
|
else
|
2022-07-13 10:42:50 -07:00
|
|
|
line="::endgroup::"
|
2021-06-14 11:16:46 -07:00
|
|
|
fi
|
2022-07-13 10:42:50 -07:00
|
|
|
echo -e "$line"
|
2020-08-21 19:06:43 -07:00
|
|
|
}
|
2020-09-10 19:34:50 +02:00
|
|
|
|
2021-11-29 22:54:07 +00:00
|
|
|
__print() {
|
|
|
|
|
local TITLE=""
|
|
|
|
|
if [[ -n $2 ]]; then
|
|
|
|
|
TITLE=" title=$2"
|
|
|
|
|
fi
|
|
|
|
|
echo "::$1${TITLE}::$3"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# $1 - title
|
|
|
|
|
# $2 - message
|
|
|
|
|
print_error() {
|
|
|
|
|
__print error $1 $2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# $1 - title
|
|
|
|
|
# $2 - message
|
|
|
|
|
print_notice() {
|
|
|
|
|
__print notice $1 $2
|
|
|
|
|
}
|