mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-06-30 14:42:12 +02:00
Group the build output in GitHub Action
This commit is contained in:
21
build-functions/gh-functions.sh
Normal file
21
build-functions/gh-functions.sh
Normal 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
|
||||
}
|
Reference in New Issue
Block a user