From ae53c501ca37f3462124a533caa63878fb241f55 Mon Sep 17 00:00:00 2001 From: JP Dhabolt Date: Fri, 14 Oct 2022 12:47:26 -0400 Subject: [PATCH 1/4] Update set-output to use GITHUB_OUTPUT file Signed-off-by: JP Dhabolt --- entrypoint.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index f7386e2e..f60a08bf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -46,6 +46,10 @@ then set -x fi +setOutput() { + echo "${1}=${2}" >> ${GITHUB_OUTPUT} +} + current_branch=$(git rev-parse --abbrev-ref HEAD) pre_release="$prerelease" @@ -113,8 +117,8 @@ commit=$(git rev-parse HEAD) if [ "$tag_commit" == "$commit" ] then echo "No new commits since previous tag. Skipping..." - echo "::set-output name=new_tag::$tag" - echo "::set-output name=tag::$tag" + setOutput "new_tag" "$tag" + setOutput "tag" "$tag" exit 0 fi @@ -128,15 +132,15 @@ case "$log" in *$patch_string_token* ) new=$(semver -i patch "$tag"); part="patch";; *$none_string_token* ) echo "Default bump was set to none. Skipping..." - echo "::set-output name=new_tag::$tag" - echo "::set-output name=tag::$tag" + setOutput "new_tag" "$tag" + setOutput "tag" "$tag" exit 0;; * ) if [ "$default_semvar_bump" == "none" ] then echo "Default bump was set to none. Skipping..." - echo "::set-output name=new_tag::$tag" - echo "::set-output name=tag::$tag" + setOutput "new_tag" "$tag" + setOutput "tag" "$tag" exit 0 else new=$(semver -i "${default_semvar_bump}" "$tag") @@ -182,10 +186,10 @@ then fi # set outputs -echo "::set-output name=new_tag::$new" -echo "::set-output name=part::$part" -echo "::set-output name=tag::$new" # this needs to go in v2 is breaking change -echo "::set-output name=old_tag::$tag" +setOutput "new_tag" "$new" +setOutput "part" "$part" +setOutput "tag" "$new" +setOutput "old_tag" "$tag" # dry run exit without real changes if $dryrun From 04d9e7f5f6c0b7a3d6ea5436f4d344ff54b2d5e5 Mon Sep 17 00:00:00 2001 From: JP Dhabolt Date: Thu, 27 Oct 2022 09:27:42 -0400 Subject: [PATCH 2/4] Add v2 comment per PR review Signed-off-by: JP Dhabolt --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f60a08bf..11469358 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -188,7 +188,7 @@ fi # set outputs setOutput "new_tag" "$new" setOutput "part" "$part" -setOutput "tag" "$new" +setOutput "tag" "$new" # this needs to go in v2 is breaking change setOutput "old_tag" "$tag" # dry run exit without real changes From 182a251b9a581f1588e97af82c4ad1ed9ccc4715 Mon Sep 17 00:00:00 2001 From: JP Dhabolt Date: Thu, 27 Oct 2022 09:29:45 -0400 Subject: [PATCH 3/4] Remove extra space Signed-off-by: JP Dhabolt --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 11469358..5d316512 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -188,7 +188,7 @@ fi # set outputs setOutput "new_tag" "$new" setOutput "part" "$part" -setOutput "tag" "$new" # this needs to go in v2 is breaking change +setOutput "tag" "$new" # this needs to go in v2 is breaking change setOutput "old_tag" "$tag" # dry run exit without real changes From 07f54962336c9bd6f2d341d670ec4a926bf9f9dd Mon Sep 17 00:00:00 2001 From: JP Dhabolt Date: Fri, 28 Oct 2022 08:51:33 -0400 Subject: [PATCH 4/4] Add double quotes per linting Signed-off-by: JP Dhabolt --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5d316512..b71fda53 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -47,7 +47,7 @@ then fi setOutput() { - echo "${1}=${2}" >> ${GITHUB_OUTPUT} + echo "${1}=${2}" >> "${GITHUB_OUTPUT}" } current_branch=$(git rev-parse --abbrev-ref HEAD)