Merge branch 'master' into customizable-wording

This commit is contained in:
Manuel Spigolon 2020-09-08 08:46:49 +02:00 committed by GitHub
commit f3ae0188d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 7 deletions

View File

@ -30,6 +30,15 @@ Make sure you use the `actions/checkout@v2` action!
with: with:
tag-prefix: '' tag-prefix: ''
``` ```
**skip-tag:** The tag is not added to the git repository (optional). Example:
```yaml
- name: 'Automated Version Bump'
uses: 'phips28/gh-action-bump-version@master'
with:
skip-tag: 'true'
```
**wording:** Customize the messages that trigger the version bump. It must be a string, case sensitive, coma separated (optional). Example: **wording:** Customize the messages that trigger the version bump. It must be a string, case sensitive, coma separated (optional). Example:
```yaml ```yaml
- name: 'Automated Version Bump' - name: 'Automated Version Bump'
@ -38,6 +47,7 @@ Make sure you use the `actions/checkout@v2` action!
minor-wording: 'add,Adds,new' minor-wording: 'add,Adds,new'
major-wording: 'MAJOR,cut-major' major-wording: 'MAJOR,cut-major'
``` ```
**PACKAGEJSON_DIR:** Param to parse the location of the desired package.json (optional). Example: **PACKAGEJSON_DIR:** Param to parse the location of the desired package.json (optional). Example:
```yaml ```yaml
- name: 'Automated Version Bump' - name: 'Automated Version Bump'

View File

@ -18,6 +18,9 @@ inputs:
major-wording: major-wording:
description: 'Words list that trigger a major version bump' description: 'Words list that trigger a major version bump'
default: 'BREAKING CHANGE,major' default: 'BREAKING CHANGE,major'
skip-tag:
description: 'Avoid to add a TAG to the version update commit'
default: 'false'
required: false required: false
PACKAGEJSON_DIR: PACKAGEJSON_DIR:
description: 'Custom dir to the package' description: 'Custom dir to the package'

View File

@ -67,11 +67,13 @@ Toolkit.run(async tools => {
'but that doesnt matter because you dont need that git commit, thats only for "actions/checkout@v1"') 'but that doesnt matter because you dont need that git commit, thats only for "actions/checkout@v1"')
} }
const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git` if (process.env['INPUT_SKIP-TAG'] !== 'true') {
// console.log(Buffer.from(remoteRepo).toString('base64')) const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git`
await tools.runInWorkspace('git', ['tag', newVersion]) // console.log(Buffer.from(remoteRepo).toString('base64'))
await tools.runInWorkspace('git', ['push', remoteRepo, '--follow-tags']) await tools.runInWorkspace('git', ['tag', newVersion])
await tools.runInWorkspace('git', ['push', remoteRepo, '--tags']) await tools.runInWorkspace('git', ['push', remoteRepo, '--follow-tags'])
await tools.runInWorkspace('git', ['push', remoteRepo, '--tags'])
}
} catch (e) { } catch (e) {
tools.log.fatal(e) tools.log.fatal(e)
tools.exit.failure('Failed to bump version') tools.exit.failure('Failed to bump version')

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "gh-action-bump-version", "name": "gh-action-bump-version",
"version": "7.2.2", "version": "7.3.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "gh-action-bump-version", "name": "gh-action-bump-version",
"version": "7.2.2", "version": "7.3.0",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/phips28/gh-action-bump-version.git" "url": "git+https://github.com/phips28/gh-action-bump-version.git"