diff --git a/README.md b/README.md index d35b2dd..fe4947a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,13 @@ Currently, changelog format and supported tag names have the following rule: | branch | false | Reject releases from commits not contained in branches that match the specified pattern (regular expression) | String | | | prefix | false | An optional pattern that matches a prefix for the release tag, before the version number (see [action.yml](action.yml) for more) | String | | +### Outputs + +| Name | Description | +|-----------------|----------------------------------------------------------------------------------------------------------------| +| computed-prefix | The computed prefix, including '-' and 'v'. | +| version | The version number extracted from the tag. The tag name is a concatenation of `computed-prefix` and `version`.-| + ### Example workflow: Basic usage ```yaml 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}"