From f1a6a3e81b28a9c9034b58efb8219511f4834efd Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sun, 6 Sep 2020 13:13:52 +0200 Subject: [PATCH 1/2] feat: skip repo tag step --- README.md | 7 +++++++ action.yml | 4 ++++ index.js | 12 +++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 771811f..1dc41f8 100644 --- a/README.md +++ b/README.md @@ -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' diff --git a/action.yml b/action.yml index 4028e0a..4d4133b 100644 --- a/action.yml +++ b/action.yml @@ -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: '' diff --git a/index.js b/index.js index bebe4ab..3c26c57 100644 --- a/index.js +++ b/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') From 69d4b3888a927207a7a190c507dcc0343e325437 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Sun, 6 Sep 2020 21:11:24 +0000 Subject: [PATCH 2/2] ci: version bump to v7.3.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5638ff2..6077204 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gh-action-bump-version", - "version": "7.2.2", + "version": "7.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 01d66ee..fb00e93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gh-action-bump-version", - "version": "7.2.2", + "version": "7.3.0", "repository": { "type": "git", "url": "git+https://github.com/phips28/gh-action-bump-version.git"