diff --git a/README.md b/README.md index ad717cf..1d443c1 100644 --- a/README.md +++ b/README.md @@ -65,16 +65,16 @@ jobs: ## Variables | Name | Description | Default | -| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | +| ------------------------------ |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| | `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. Required if `push: true` | - | | `working_directory` | Change to this directory before running | repo root directory | | `dry_run` | Run without creating commit, output to stdout | false | | `repository` | Repository name to push. Default or empty value represents current github repository | current one | | `branch` | Destination branch to push changes | Same as the one executing the action by default | | `prerelease` | Set as prerelease {alpha,beta,rc} choose type of prerelease | - | -| `devrelease` | Non-negative integer for dev. release | - | -| `local_version` | Bump only the local version portion | - | -| `build_metadata` | Specifies additional metadata in the version string, creates a version like `1.1.2+yourmetadata` | - | +| `devrelease` | Non-negative integer for dev. release | - | +| `local_version` | Bump only the local version portion | - | +| `build_metadata` | Specifies additional metadata in the version string, creates a version like `1.1.2+yourmetadata` | - | | `extra_requirements` | Custom requirements, if your project uses a custom rule or plugins, you can specify them separated by a space. E.g: `'commitizen-emoji conventional-JIRA'` | - | | `changelog_increment_filename` | Filename to store the incremented generated changelog. This is different to changelog as it only contains the changes for the just generated version. Example: `body.md` | - | | `git_redirect_stderr` | Redirect git output to stderr. Useful if you do not want git output in your changelog | `false` | @@ -87,6 +87,7 @@ jobs: | `changelog` | Create changelog when bumping the version | true | | `no_raise` | Don't raise the given comma-delimited exit codes (e.g., no_raise: '20,21'). Use with caution! Open an issue in [commitizen](https://github.com/commitizen-tools/commitizen/issues) if you need help thinking about your workflow. | [21](https://commitizen-tools.github.io/commitizen/exit_codes/) | | `increment` | Manually specify the desired increment {MAJOR,MINOR, PATCH} | - | +| `increment_mode` | Specify the increment mode {linear, exact} | `linear` | | `check_consistency` | Check consistency among versions defined in commitizen configuration and version_files | `false` | | `gpg_sign` | If true, use GPG to sign commits and tags (for git operations). Requires separate setup of GPG key and passphrase in GitHub Actions (e.g. with the action `crazy-max/ghaction-import-gpg`) | `false` | | `debug` | Prints debug output to GitHub Actions stdout | `false` | diff --git a/action.yml b/action.yml index 16c3985..f95d3f4 100644 --- a/action.yml +++ b/action.yml @@ -101,6 +101,10 @@ inputs: increment: description: "Manually specify the desired increment" required: false + increment_mode: + description: "Mode for incrementing version (linear, exact)" + required: false + default: "linear" check_consistency: default: "false" description: "check consistency among versions defined in commitizen configuration and version_files" diff --git a/entrypoint.sh b/entrypoint.sh index 9e3c655..9073593 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -82,6 +82,9 @@ fi if [[ $INPUT_INCREMENT ]]; then CZ_CMD+=('--increment' "$INPUT_INCREMENT") fi +if [[ $INPUT_INCREMENT_MODE && ("$INPUT_INCREMENT_MODE" == "linear" || "$INPUT_INCREMENT_MODE" == "exact") ]]; then + CZ_CMD+=('--increment-mode' "$INPUT_INCREMENT_MODE") +fi if [[ $INPUT_CHECK_CONSISTENCY == 'true' ]]; then CZ_CMD+=('--check-consistency') fi