diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 33bc11a..d736074 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -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 diff --git a/README.md b/README.md index bb37e5b..aa6d97f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 9ac7d95..20577f1 100644 --- a/action.yml +++ b/action.yml @@ -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: diff --git a/dist/index.js b/dist/index.js index 33cb6a0..118bf22 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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.' diff --git a/index.js b/index.js index d589f53..a1e0c7b 100644 --- a/index.js +++ b/index.js @@ -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.'