Group the build output in GitHub Action

This commit is contained in:
Christian Mäder 2021-10-05 10:22:00 +02:00
parent 5f0b7467d1
commit 30a7aa0e9c
2 changed files with 36 additions and 7 deletions

View file

@ -0,0 +1,21 @@
#!/bin/bash
###
# A regular echo, that only prints if ${GH_ACTION} is defined.
###
gh_echo() {
if [ -n "${GH_ACTION}" ]; then
echo "${@}"
fi
}
###
# Prints the output to the file defined in ${GITHUB_ENV}.
# Only executes if ${GH_ACTION} is defined.
# Example Usage: gh_env "FOO_VAR=bar_value"
###
gh_env() {
if [ -n "${GH_ACTION}" ]; then
echo "${@}" >>"${GITHUB_ENV}"
fi
}