From b2e192e120a661475ca63ba21f27cd905973d72a Mon Sep 17 00:00:00 2001 From: Rain Date: Wed, 16 Feb 2022 11:25:28 -0800 Subject: [PATCH] Set computed-prefix and version outputs I've found these to be useful while composing this action with others. --- action.yml | 8 ++++++++ main.sh | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/action.yml b/action.yml index 34c3921..88928e2 100644 --- a/action.yml +++ b/action.yml @@ -37,6 +37,14 @@ inputs: required: false default: '' +outputs: + computed-prefix: + description: > + The computed prefix, including '-' and 'v' if found. + version: + description: + The version number extracted from the tag. The tag name is a concatenation of computed-prefix + and version. runs: using: node16 main: main.js diff --git a/main.sh b/main.sh index 3552b6f..a0a778d 100755 --- a/main.sh +++ b/main.sh @@ -98,3 +98,8 @@ fi # https://cli.github.com/manual/gh_release_create gh release create ${draft_option:-} "${tag}" ${prerelease:-} --title "${title}" --notes "${notes:-}" + +# set (computed) prefix and version outputs for future step use +computed_prefix=${tag%"$version"} +echo "::set-output name=computed-prefix::${computed_prefix}" +echo "::set-output name=version::${version}"