Merge pull request #2 from Travelport-Czech/add_tag_prefix
Add tag prefix
This commit is contained in:
commit
067cc37639
|
@ -23,6 +23,8 @@ jobs:
|
||||||
node-version: 8.10.0
|
node-version: 8.10.0
|
||||||
- name: "Automated Version Bump"
|
- name: "Automated Version Bump"
|
||||||
uses: "phips28/gh-action-bump-version@master"
|
uses: "phips28/gh-action-bump-version@master"
|
||||||
|
with:
|
||||||
|
tag-prefix: ''
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: "cat package.json"
|
- name: "cat package.json"
|
||||||
|
|
|
@ -25,7 +25,7 @@ COPY package*.json ./
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get -y install git
|
RUN apt-get -y install git
|
||||||
|
|
||||||
RUN npm ci
|
RUN npm ci --only=production
|
||||||
|
|
||||||
|
|
||||||
# Copy the rest of your action's code
|
# Copy the rest of your action's code
|
||||||
|
|
|
@ -6,3 +6,8 @@ runs:
|
||||||
branding:
|
branding:
|
||||||
icon: chevron-up
|
icon: chevron-up
|
||||||
color: blue
|
color: blue
|
||||||
|
inputs:
|
||||||
|
tag-prefix:
|
||||||
|
description: 'Prefix that is used for the git tag'
|
||||||
|
default: ''
|
||||||
|
required: false
|
||||||
|
|
1
index.js
1
index.js
|
@ -45,6 +45,7 @@ Toolkit.run(async tools => {
|
||||||
['version', '--allow-same-version=true', '--git-tag-version=false', current])
|
['version', '--allow-same-version=true', '--git-tag-version=false', current])
|
||||||
console.log('current:', current, '/', 'version:', version)
|
console.log('current:', current, '/', 'version:', version)
|
||||||
newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString().trim()
|
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('new version:', newVersion)
|
||||||
await tools.runInWorkspace('git', ['commit', '-a', '-m', `"ci: ${commitMessage} ${newVersion}"`])
|
await tools.runInWorkspace('git', ['commit', '-a', '-m', `"ci: ${commitMessage} ${newVersion}"`])
|
||||||
|
|
||||||
|
|
|
@ -6140,4 +6140,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue