mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-06 21:04:07 +07:00
Fix output on non GitHub Action environments
This commit is contained in:
@ -11,6 +11,14 @@ export github="https://github.com/shivammathur"
|
||||
export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur"
|
||||
export setup_php="https://setup-php.com"
|
||||
|
||||
if [ -n "${GITHUB_ACTIONS}" ]; then
|
||||
export GROUP='::group::'
|
||||
export END_GROUP='::endgroup::'
|
||||
else
|
||||
export GROUP=''
|
||||
export END_GROUP=''
|
||||
fi
|
||||
|
||||
# Function to log start of a operation.
|
||||
step_log() {
|
||||
message=$1
|
||||
@ -30,6 +38,15 @@ add_log() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to set output on GitHub Actions.
|
||||
set_output() {
|
||||
name=$1
|
||||
value=$2
|
||||
if [ "${GITHUB_ACTIONS}" = "true" ]; then
|
||||
echo "::set-output name=${name}::${value}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to read env inputs.
|
||||
read_env() {
|
||||
update="${update:-${UPDATE:-false}}"
|
||||
|
Reference in New Issue
Block a user