Skip to content

Commit

Permalink
feat: Add version to the output feild.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jan 8, 2021
1 parent aa8196e commit 1c69ace
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ jobs:
- name: Get the branch name
run: echo "${{ steps.changelog.outputs.branch }}"

- name: Get comparing changes url,
- name: Get comparing changes url.
run: echo "${{ steps.changelog.outputs.compareurl }}"

- name: The version number of the tag created.
run: echo "${{ steps.changelog.outputs.version }}"

- name: Create Release
id: create_release
uses: actions/create-release@latest
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ The name of the second branch. Defaults to the `tag_name` of the latest GitHub r

- `changelog` Markdown formatted changelog.
- `compareurl` Comparing two branches to see what’s changed or to start a new pull request.
- `tag` Tag name.
- `tag` Tag name `v1.0.0`.
- `version` The version number of the tag created. example: `1.0.0`
- `branch` Branch name.

## Troubleshooting
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ inputs:
required: false

outputs:
version:
description: 'The version number of the tag created. example: 1.0.0'
changelog:
description: 'Markdown formatted changelog'
compareurl:
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ async function run() {
core.endGroup();
core.setOutput('compareurl', `https://github.com/${owner}/${repo}/compare/${baseRef}...${tagRef || headRef}`);
core.setOutput('changelog', changelog);
core.setOutput('version', getVersion(github.ref).replace(/^v/, ''));
} else {
core.setFailed(
'Branch names must contain only numbers, strings, underscores, periods, and dashes.'
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ async function run() {
core.endGroup();
core.setOutput('compareurl', `https://github.com/${owner}/${repo}/compare/${baseRef}...${tagRef || headRef}`);
core.setOutput('changelog', changelog);
core.setOutput('version', getVersion(github.ref).replace(/^v/, ''));
} else {
core.setFailed(
'Branch names must contain only numbers, strings, underscores, periods, and dashes.'
Expand Down

0 comments on commit 1c69ace

Please sign in to comment.