Merge pull request #103 from kevcube/master

Make push optional
This commit is contained in:
Phil 2021-07-16 10:16:49 +02:00 committed by GitHub
commit feb02696ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 3 deletions

View File

@ -107,3 +107,13 @@ Make sure you use the `actions/checkout@v2` action!
with:
commit-message: 'CI: bumps version to {{version}} [skip ci]'
```
**push:** Set false you want to avoid pushing the new version tag/package.json. Example:
```yaml
- name: 'Automated Version Bump'
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
push: false
```

View File

@ -50,6 +50,10 @@ inputs:
description: 'Set a custom commit message for version bump commit'
default: ''
required: false
push:
description: 'Set to false to skip pushing the new tag'
default: 'true'
required: false
outputs:
newTag:
description: 'The newly created tag'

View File

@ -105,6 +105,13 @@ Toolkit.run(async (tools) => {
return;
}
// case: if user sets push to false, to skip pushing new tag/package.json
const push = process.env['INPUT_PUSH']
if ( push === "false" || push === false ) {
tools.exit.success('User requested to skip pushing new tag and package.json. Finished.');
return;
}
// GIT logic
try {
const current = pkg.version.toString();