Skip to content

Commit

Permalink
feat: add skip-tag to skip tagging a release
Browse files Browse the repository at this point in the history
  • Loading branch information
cdotyab authored and cdotyab committed Nov 17, 2022
1 parent c989d55 commit 22e862a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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');
Expand All @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 22e862a

Please sign in to comment.