diff --git a/README.md b/README.md index 30578e8..9984661 100644 --- a/README.md +++ b/README.md @@ -64,21 +64,22 @@ jobs: ## Variables -| Name | Description | Default | -| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- | -| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - | -| `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 | - | -| `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_name` | Name used to configure git (for git operations) | `github-actions[bot]` | -| `git_email` | Email address used to configure git (for git operations) | `github-actions[bot]@users.noreply.github.com` | -| `push` | Define if the changes should be pushed to the branch. | true | -| `commit` | Define if the changes should be committed to the branch. | true | -| `commitizen_version` | Specify the version to be used by commitizen. Eg: `2.21.0` | latest | -| `changelog` | Create changelog when bumping the version | true | +| Name | Description | Default | +| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | +| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - | +| `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 | - | +| `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_name` | Name used to configure git (for git operations) | `github-actions[bot]` | +| `git_email` | Email address used to configure git (for git operations) | `github-actions[bot]@users.noreply.github.com` | +| `push` | Define if the changes should be pushed to the branch. | true | +| `commit` | Define if the changes should be committed to the branch. | true | +| `commitizen_version` | Specify the version to be used by commitizen. Eg: `2.21.0` | latest | +| `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/) | ## Outputs diff --git a/action.yml b/action.yml index a66a623..c0955bf 100644 --- a/action.yml +++ b/action.yml @@ -57,4 +57,8 @@ inputs: commitizen_version: description: 'Specify the version to be used by commitizen' required: false - default: 'latest' + default: latest + no_raise: + description: "Don't raise the given comma-delimited exit codes" + required: false + default: '21' diff --git a/entrypoint.sh b/entrypoint.sh index 580d80b..87c6eac 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ if [ $INPUT_CHANGELOG ]; then INPUT_CHANGELOG='--changelog'; else INPUT_CHANGELO if [ $INPUT_PRERELEASE ]; then INPUT_PRERELEASE="--prerelease $INPUT_PRERELEASE"; else INPUT_PRERELEASE=''; fi if [ "$INPUT_COMMIT" == 'false' ]; then INPUT_COMMIT='--files-only'; else INPUT_COMMIT=''; fi if [ "$INPUT_COMMITIZEN_VERSION" == 'latest' ]; then INPUT_COMMITIZEN_VERSION="commitizen"; else INPUT_COMMITIZEN_VERSION="commitizen==$INPUT_COMMITIZEN_VERSION"; fi - +if [ -n "$INPUT_NO_RAISE" ]; then INPUT_NO_RAISE="--no-raise $INPUT_NO_RAISE"; else INPUT_NO_RAISE=''; fi CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) INPUT_BRANCH=${INPUT_BRANCH:-$CURRENT_BRANCH} @@ -37,9 +37,9 @@ echo "Git email: $(git config --get user.email)" echo "Running cz: $INPUT_DRY_RUN $INPUT_COMMIT $INPUT_CHANGELOG $INPUT_PRERELEASE" if [ $INPUT_CHANGELOG_INCREMENT_FILENAME ]; then - cz bump --yes --changelog-to-stdout $INPUT_COMMIT $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE >$INPUT_CHANGELOG_INCREMENT_FILENAME + cz $INPUT_NO_RAISE bump --yes --changelog-to-stdout $INPUT_COMMIT $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE >$INPUT_CHANGELOG_INCREMENT_FILENAME else - cz bump --yes $INPUT_DRY_RUN $INPUT_COMMIT $INPUT_CHANGELOG $INPUT_PRERELEASE + cz $INPUT_NO_RAISE bump --yes $INPUT_DRY_RUN $INPUT_COMMIT $INPUT_CHANGELOG $INPUT_PRERELEASE fi REV=$(cz version --project)