Merge pull request #61 from falko189/add-output-tag
Added output of the tag to the action
This commit is contained in:
commit
f662615664
|
@ -22,6 +22,7 @@ jobs:
|
|||
with:
|
||||
node-version: 12
|
||||
- name: "Automated Version Bump"
|
||||
id: version-bump
|
||||
uses: "phips28/gh-action-bump-version@master"
|
||||
with:
|
||||
tag-prefix: ''
|
||||
|
@ -29,3 +30,7 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: "cat package.json"
|
||||
run: cat ./package.json
|
||||
- name: 'Output Step'
|
||||
env:
|
||||
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
|
||||
run: echo "new tag $NEW_TAG"
|
||||
|
|
|
@ -35,3 +35,6 @@ inputs:
|
|||
description: 'Set a default version bump to use'
|
||||
default: 'patch'
|
||||
required: false
|
||||
outputs:
|
||||
newTag:
|
||||
description: 'The newly created tag'
|
||||
|
|
1
index.js
1
index.js
|
@ -97,6 +97,7 @@ Toolkit.run(async tools => {
|
|||
newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString().trim()
|
||||
newVersion = `${process.env['INPUT_TAG-PREFIX']}${newVersion}`
|
||||
console.log('new version:', newVersion)
|
||||
console.log(`::set-output name=newTag::${newVersion}`)
|
||||
try {
|
||||
// to support "actions/checkout@v1"
|
||||
await tools.runInWorkspace('git', ['commit', '-a', '-m', `ci: ${commitMessage} ${newVersion}`])
|
||||
|
|
Loading…
Reference in New Issue