ci: create helpers for formatting errors and notices

Create helpers for formatting errors and notices for GitHub actions,
instead of directly printing the double colons and attributes.
This commit is contained in:
Quentin Monnet
2021-11-29 22:54:07 +00:00
committed by Andrii Nakryiko
parent 4374bad784
commit 7f11cd48d6
2 changed files with 22 additions and 2 deletions

View File

@@ -24,3 +24,23 @@ travis_fold() {
}
ARCH=$(uname -m)
__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
}