Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set computed-prefix and version outputs #12

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"