commit
f04713bd30
|
@ -30,6 +30,13 @@ Make sure you use the `actions/checkout@v2` action!
|
|||
with:
|
||||
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'
|
||||
```
|
||||
**PACKAGEJSON_DIR:** Param to parse the location of the desired package.json (optional). Example:
|
||||
```yaml
|
||||
- name: 'Automated Version Bump'
|
||||
|
|
|
@ -11,6 +11,10 @@ inputs:
|
|||
description: 'Prefix that is used for the git tag'
|
||||
default: ''
|
||||
required: false
|
||||
skip-tag:
|
||||
description: 'Avoid to add a TAG to the version update commit'
|
||||
default: 'false'
|
||||
required: false
|
||||
PACKAGEJSON_DIR:
|
||||
description: 'Custom dir to the package'
|
||||
default: ''
|
||||
|
|
12
index.js
12
index.js
|
@ -66,11 +66,13 @@ Toolkit.run(async tools => {
|
|||
'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`
|
||||
// console.log(Buffer.from(remoteRepo).toString('base64'))
|
||||
await tools.runInWorkspace('git', ['tag', newVersion])
|
||||
await tools.runInWorkspace('git', ['push', remoteRepo, '--follow-tags'])
|
||||
await tools.runInWorkspace('git', ['push', remoteRepo, '--tags'])
|
||||
if (process.env['INPUT_SKIP-TAG'] !== 'true') {
|
||||
const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git`
|
||||
// console.log(Buffer.from(remoteRepo).toString('base64'))
|
||||
await tools.runInWorkspace('git', ['tag', newVersion])
|
||||
await tools.runInWorkspace('git', ['push', remoteRepo, '--follow-tags'])
|
||||
await tools.runInWorkspace('git', ['push', remoteRepo, '--tags'])
|
||||
}
|
||||
} catch (e) {
|
||||
tools.log.fatal(e)
|
||||
tools.exit.failure('Failed to bump version')
|
||||
|
|
Loading…
Reference in New Issue