From b7a3dd9b3f4e12576c6a9c26e0f7a555be96b98d Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Thu, 22 Dec 2022 14:41:17 +0100 Subject: [PATCH] Add _set_github_output function --- entrypoint.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 3c85831..a75aba2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,6 +6,19 @@ if "$INPUT_DISABLE_GLOBBING"; then set -o noglob; fi +_set_github_output() { + local name=${1} + local value=${2} + + # Check if $GITHUB_OUTPUT is available + # (Feature detection will be removed in late December 2022) + if [ -z ${GITHUB_OUTPUT+x} ]; then + echo "::set-output name=$name::$value"; + else + echo "$name=$value" >> $GITHUB_OUTPUT; + fi +} + _main() { _check_if_git_is_available