Skip to content

Commit 8ae943d

Browse files
authored
Merge pull request #25 from commitizen-tools/feat/add-no-raise
feat: add no-raise option
2 parents 2e11e3c + 1ee6ed8 commit 8ae943d

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

Diff for: README.md

+16-15
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,22 @@ jobs:
6464
6565
## Variables
6666
67-
| Name | Description | Default |
68-
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- |
69-
| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - |
70-
| `dry_run` | Run without creating commit, output to stdout | false |
71-
| `repository` | Repository name to push. Default or empty value represents current github repository | current one |
72-
| `branch` | Destination branch to push changes | Same as the one executing the action by default |
73-
| `prerelease` | Set as prerelease {alpha,beta,rc} choose type of prerelease | - |
74-
| `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'` | - |
75-
| `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` | - |
76-
| `git_name` | Name used to configure git (for git operations) | `github-actions[bot]` |
77-
| `git_email` | Email address used to configure git (for git operations) | `github-actions[bot]@users.noreply.github.com` |
78-
| `push` | Define if the changes should be pushed to the branch. | true |
79-
| `commit` | Define if the changes should be committed to the branch. | true |
80-
| `commitizen_version` | Specify the version to be used by commitizen. Eg: `2.21.0` | latest |
81-
| `changelog` | Create changelog when bumping the version | true |
67+
| Name | Description | Default |
68+
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
69+
| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` **required** | - |
70+
| `dry_run` | Run without creating commit, output to stdout | false |
71+
| `repository` | Repository name to push. Default or empty value represents current github repository | current one |
72+
| `branch` | Destination branch to push changes | Same as the one executing the action by default |
73+
| `prerelease` | Set as prerelease {alpha,beta,rc} choose type of prerelease | - |
74+
| `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'` | - |
75+
| `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` | - |
76+
| `git_name` | Name used to configure git (for git operations) | `github-actions[bot]` |
77+
| `git_email` | Email address used to configure git (for git operations) | `github-actions[bot]@users.noreply.github.com` |
78+
| `push` | Define if the changes should be pushed to the branch. | true |
79+
| `commit` | Define if the changes should be committed to the branch. | true |
80+
| `commitizen_version` | Specify the version to be used by commitizen. Eg: `2.21.0` | latest |
81+
| `changelog` | Create changelog when bumping the version | true |
82+
| `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/) |
8283

8384
## Outputs
8485

Diff for: action.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,8 @@ inputs:
5757
commitizen_version:
5858
description: 'Specify the version to be used by commitizen'
5959
required: false
60-
default: 'latest'
60+
default: latest
61+
no_raise:
62+
description: "Don't raise the given comma-delimited exit codes"
63+
required: false
64+
default: '21'

Diff for: entrypoint.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ $INPUT_CHANGELOG ]; then INPUT_CHANGELOG='--changelog'; else INPUT_CHANGELO
55
if [ $INPUT_PRERELEASE ]; then INPUT_PRERELEASE="--prerelease $INPUT_PRERELEASE"; else INPUT_PRERELEASE=''; fi
66
if [ "$INPUT_COMMIT" == 'false' ]; then INPUT_COMMIT='--files-only'; else INPUT_COMMIT=''; fi
77
if [ "$INPUT_COMMITIZEN_VERSION" == 'latest' ]; then INPUT_COMMITIZEN_VERSION="commitizen"; else INPUT_COMMITIZEN_VERSION="commitizen==$INPUT_COMMITIZEN_VERSION"; fi
8-
8+
if [ -n "$INPUT_NO_RAISE" ]; then INPUT_NO_RAISE="--no-raise $INPUT_NO_RAISE"; else INPUT_NO_RAISE=''; fi
99

1010
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
1111
INPUT_BRANCH=${INPUT_BRANCH:-$CURRENT_BRANCH}
@@ -37,9 +37,9 @@ echo "Git email: $(git config --get user.email)"
3737
echo "Running cz: $INPUT_DRY_RUN $INPUT_COMMIT $INPUT_CHANGELOG $INPUT_PRERELEASE"
3838

3939
if [ $INPUT_CHANGELOG_INCREMENT_FILENAME ]; then
40-
cz bump --yes --changelog-to-stdout $INPUT_COMMIT $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE >$INPUT_CHANGELOG_INCREMENT_FILENAME
40+
cz $INPUT_NO_RAISE bump --yes --changelog-to-stdout $INPUT_COMMIT $INPUT_DRY_RUN $INPUT_CHANGELOG $INPUT_PRERELEASE >$INPUT_CHANGELOG_INCREMENT_FILENAME
4141
else
42-
cz bump --yes $INPUT_DRY_RUN $INPUT_COMMIT $INPUT_CHANGELOG $INPUT_PRERELEASE
42+
cz $INPUT_NO_RAISE bump --yes $INPUT_DRY_RUN $INPUT_COMMIT $INPUT_CHANGELOG $INPUT_PRERELEASE
4343
fi
4444

4545
REV=$(cz version --project)

0 commit comments

Comments
 (0)