2021-10-05 10:22:00 +02:00
|
|
|
#!/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
|
|
|
|
}
|
2023-01-28 15:42:32 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# Prints the output to the file defined in ${GITHUB_OUTPUT}.
|
|
|
|
# Only executes if ${GH_ACTION} is defined.
|
|
|
|
# Example Usage: gh_env "FOO_VAR=bar_value"
|
|
|
|
###
|
|
|
|
gh_out() {
|
|
|
|
if [ -n "${GH_ACTION}" ]; then
|
|
|
|
echo "${@}" >>"$GITHUB_OUTPUT"
|
|
|
|
fi
|
|
|
|
}
|