feat: add skip-tag to skip tagging a release

releases/v3
cdotyab 2022-11-17 14:07:56 -06:00
parent c989d559ea
commit 22e862a0ab
3 changed files with 14 additions and 1 deletions

View File

@ -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-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-version-file`: Do not update the version file. Default `'false'`.
- **Optional** `skip-commit`: Do not create a release commit. 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** `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** `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 - **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 ### 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. 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: example:
```javascript ```javascript
'use strict' 'use strict'
const config = require('conventional-changelog-conventionalcommits'); const config = require('conventional-changelog-conventionalcommits');
@ -92,6 +95,7 @@ module.exports = config({
"issueUrlFormat": "https://jira.example.com/browse/{{prefix}}{{id}}" "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. 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. Make sure to install all required packages in the workflow before executing this action.

View File

@ -96,6 +96,11 @@ inputs:
default: 'false' default: 'false'
required: 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: pre-commit:
description: 'Path to the pre-commit script file' description: 'Path to the pre-commit script file'
required: false required: false

View File

@ -41,6 +41,7 @@ async function run() {
const skipVersionFile = core.getBooleanInput('skip-version-file') const skipVersionFile = core.getBooleanInput('skip-version-file')
const skipCommit = core.getBooleanInput('skip-commit') const skipCommit = core.getBooleanInput('skip-commit')
const skipEmptyRelease = core.getBooleanInput('skip-on-empty') const skipEmptyRelease = core.getBooleanInput('skip-on-empty')
const skipTag = core.getBooleanInput('skip-tag')
const conventionalConfigFile = core.getInput('config-file-path') const conventionalConfigFile = core.getInput('config-file-path')
const preChangelogGenerationFile = core.getInput('pre-changelog-generation') const preChangelogGenerationFile = core.getInput('pre-changelog-generation')
const gitUrl = core.getInput('git-url') const gitUrl = core.getInput('git-url')
@ -187,7 +188,10 @@ async function run() {
} }
// Create the new tag // Create the new tag
if (!skipTag)
await git.createTag(gitTag) await git.createTag(gitTag)
else
core.info('We not going to the tag the GIT changes')
if (gitPush) { if (gitPush) {
try { try {