From 22e862a0ab69410642c4182cd9ee27a23d8c63a0 Mon Sep 17 00:00:00 2001 From: cdotyab Date: Thu, 17 Nov 2022 14:07:56 -0600 Subject: [PATCH] feat: add skip-tag to skip tagging a release --- README.md | 4 ++++ action.yml | 5 +++++ src/index.js | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index df5b69e..37a3248 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ This action will bump version, tag commit and generate a changelog with conventi - **Optional** `skip-on-empty`: Boolean to specify if you want to skip empty release (no-changelog generated). This case occurred when you push `chore` commit with `angular` for example. Default `'true'`. - **Optional** `skip-version-file`: Do not update the version file. Default `'false'`. - **Optional** `skip-commit`: Do not create a release commit. Default `'false'`. +- **Optional** `skip-tag`: Do not tag the release. Helpful for using action to check if a release is going to be made. Default `'false'`. - **Optional** `pre-commit`: Path to the pre-commit script file. No hook by default. - **Optional** `fallback-version`: The fallback version, if no older one can be detected, or if it is the first one. Default `'0.1.0'` - **Optional** `config-file-path`: Path to the conventional changelog config file. If set, the preset setting will be ignored @@ -80,9 +81,11 @@ export function preTagGeneration(tag: string): string {} ``` ### Config-File-Path + A config file to define the conventional commit settings. Use it if you need to override values like `issuePrefix` or `issueUrlFormat`. If you set a `config-file-path`, the `preset` setting will be ignored. Therefore use an existing config and override the values you want to adjust. example: + ```javascript 'use strict' const config = require('conventional-changelog-conventionalcommits'); @@ -92,6 +95,7 @@ module.exports = config({ "issueUrlFormat": "https://jira.example.com/browse/{{prefix}}{{id}}" }) ``` + The specified path can be relative or absolute. If it is relative, then it will be based on the `GITHUB_WORKSPACE` path. Make sure to install all required packages in the workflow before executing this action. diff --git a/action.yml b/action.yml index 3d0ba37..6f3db70 100644 --- a/action.yml +++ b/action.yml @@ -96,6 +96,11 @@ inputs: default: 'false' required: false + skip-tag: + description: 'Do not tag the release. Helpful for using action to check if a release is going to be made' + default: 'false' + required: false + pre-commit: description: 'Path to the pre-commit script file' required: false diff --git a/src/index.js b/src/index.js index 0c05e1c..d72a058 100644 --- a/src/index.js +++ b/src/index.js @@ -41,6 +41,7 @@ async function run() { const skipVersionFile = core.getBooleanInput('skip-version-file') const skipCommit = core.getBooleanInput('skip-commit') const skipEmptyRelease = core.getBooleanInput('skip-on-empty') + const skipTag = core.getBooleanInput('skip-tag') const conventionalConfigFile = core.getInput('config-file-path') const preChangelogGenerationFile = core.getInput('pre-changelog-generation') const gitUrl = core.getInput('git-url') @@ -187,7 +188,10 @@ async function run() { } // Create the new tag - await git.createTag(gitTag) + if (!skipTag) + await git.createTag(gitTag) + else + core.info('We not going to the tag the GIT changes') if (gitPush) { try {