From f9cca350aeb05f738d048c4b885bbcd303cdf162 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Thu, 13 Oct 2022 23:11:52 +0900 Subject: [PATCH 1/3] migrate set-output command to environment files set-output commands are now deprecated. https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ GitHub recommends environment files instead. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files --- entrypoint.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index ef8b312..ed48a0c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,6 +37,16 @@ list_versions() { fi } +set_output() { + name=$1 + value=$2 + if [ -n "${GITHUB_OUTPUT}" ]; then + echo "$name=$value" >> "{$GITHUB_OUTPUT}" + else + echo "::set-output name=$name::$value" + fi +} + LATEST_VERSION="$(\ list_versions | \ grep -oP '\d+(\.\d+)+(-[^'\''\"\s]*)?$'| \ @@ -51,9 +61,9 @@ fi echo "Latest ${VERSION_NAME}=${LATEST_VERSION}" # Set outputs. -echo "::set-output name=current::${CURRENT_VERSION}" -echo "::set-output name=latest::${LATEST_VERSION}" -echo "::set-output name=repo::${REPO}" +set_output current "${CURRENT_VERSION}" +set_output latest "${LATEST_VERSION}" +set_output repo "${REPO}" if [ "${CURRENT_VERSION}" = "${LATEST_VERSION}" ]; then echo "${VERSION_NAME} is latest. Nothing to do." From 37e829d169253262f8a1e73ed65ff933aef29b45 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Thu, 13 Oct 2022 23:16:47 +0900 Subject: [PATCH 2/3] fix the file path --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index ed48a0c..3ae0006 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -41,7 +41,7 @@ set_output() { name=$1 value=$2 if [ -n "${GITHUB_OUTPUT}" ]; then - echo "$name=$value" >> "{$GITHUB_OUTPUT}" + echo "$name=$value" >> "${GITHUB_OUTPUT}" else echo "::set-output name=$name::$value" fi From 7eb43fb92e36e4cc82f578274716cd456add8bc0 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Sat, 15 Oct 2022 02:01:15 +0900 Subject: [PATCH 3/3] Update entrypoint.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Łukasz Skarżyński --- entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3ae0006..8e20c71 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,9 +61,9 @@ fi echo "Latest ${VERSION_NAME}=${LATEST_VERSION}" # Set outputs. -set_output current "${CURRENT_VERSION}" -set_output latest "${LATEST_VERSION}" -set_output repo "${REPO}" +set_output "current" "${CURRENT_VERSION}" +set_output "latest" "${LATEST_VERSION}" +set_output "repo" "${REPO}" if [ "${CURRENT_VERSION}" = "${LATEST_VERSION}" ]; then echo "${VERSION_NAME} is latest. Nothing to do."