{"id":18752170,"url":"https://github.com/commitizen-tools/commitizen-action","last_synced_at":"2026-01-18T01:41:19.361Z","repository":{"id":38131864,"uuid":"287308634","full_name":"commitizen-tools/commitizen-action","owner":"commitizen-tools","description":"Commitizen github action to bump and create changelog","archived":false,"fork":false,"pushed_at":"2025-02-25T02:28:20.000Z","size":107,"stargazers_count":86,"open_issues_count":13,"forks_count":42,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T02:01:33.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commitizen-tools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-13T14:56:47.000Z","updated_at":"2025-03-27T09:52:42.000Z","dependencies_parsed_at":"2024-03-05T20:24:06.607Z","dependency_job_id":"3822c569-e3c0-4978-b252-21e6609e50d2","html_url":"https://github.com/commitizen-tools/commitizen-action","commit_stats":{"total_commits":105,"total_committers":21,"mean_commits":5.0,"dds":0.7142857142857143,"last_synced_commit":"899b309543154e83c02133cdc663b1ef4297d7f9"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commitizen-tools%2Fcommitizen-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commitizen-tools%2Fcommitizen-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commitizen-tools%2Fcommitizen-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commitizen-tools%2Fcommitizen-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commitizen-tools","download_url":"https://codeload.github.com/commitizen-tools/commitizen-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633567,"owners_count":21136891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T17:19:02.929Z","updated_at":"2026-01-18T01:41:19.352Z","avatar_url":"https://github.com/commitizen-tools.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commitizen-action\n\nAdd [commitizen][cz] incredibly fast into your project!\n\n## Features\n\n- Allow prerelease\n- Super easy to setup\n- Automatically bump version\n- Automatically create changelog\n- Update any file in your repo with the new version\n\nAre you using [conventional commits][cc] and [semver][semver]?\n\nThen you are ready to use this github action! The only thing you'll need is the\n`.cz.toml` file in your project.\n\n## Usage\n\n1. In your repository create a `.cz.toml` file (you can run `cz init` to create it)\n2. Create a `.github/workflows/bumpversion.yaml` with the Sample Workflow\n\n### Minimal configuration\n\nYour `.cz.toml` (or `pyproject.toml` if you are using python) should look like\nthis.\n\n```toml\n[tool.commitizen]\nversion = \"0.1.0\"  # This should be your current semver version\n```\n\nFor more information visit [commitizen's configuration page][cz-conf]\n\n## Sample Workflow\n\n```yaml\nname: Bump version\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  bump_version:\n    if: \"!startsWith(github.event.head_commit.message, 'bump:')\"\n    runs-on: ubuntu-latest\n    name: \"Bump version and create changelog with commitizen\"\n    steps:\n      - name: Check out\n        uses: actions/checkout@v5\n        with:\n          fetch-depth: 0\n          token: \"${{ secrets.GITHUB_TOKEN }}\"\n      - id: cz\n        name: Create bump and changelog\n        uses: commitizen-tools/commitizen-action@master\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n      - name: Print Version\n        run: echo \"Bumped to version ${{ steps.cz.outputs.version }}\"\n```\n\n## Variables\n\n| Name                           | Description                                                                                                                                                                                                                       | Default                                                         |\n| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |\n| `github_token`                 | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. Required if `push: true`                                                                                                                                | -                                                               |\n| `working_directory`            | Change to this directory before running                                                                                                                                                                                           | repo root directory                                             |\n| `dry_run`                      | Run without creating commit, output to stdout                                                                                                                                                                                     | false                                                           |\n| `repository`                   | Repository name to push. Default or empty value represents current github repository                                                                                                                                              | current one                                                     |\n| `branch`                       | Destination branch to push changes                                                                                                                                                                                                | Same as the one executing the action by default                 |\n| `prerelease`                   | Set as prerelease {alpha,beta,rc} choose type of prerelease                                                                                                                                                                       | -                                                               |\n| `devrelease`                   | Non-negative integer for dev. release                                                                                                                                                                          | -                                                               |\n| `local_version`                | Bump only the local version portion                                                                                                                                                                          | -                                                               |\n| `build_metadata`               | Specifies additional metadata in the version string, creates a version like `1.1.2+yourmetadata`                                                                                                                                                                   | -                                                               |\n| `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'`                                                                        | -                                                               |\n| `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`                                                          | -                                                               |\n| `git_redirect_stderr`          | Redirect git output to stderr. Useful if you do not want git output in your changelog                                                                                                                                             | `false`                                                         |\n| `git_name`                     | Name used to configure git (for git operations)                                                                                                                                                                                   | `github-actions[bot]`                                           |\n| `git_email`                    | Email address used to configure git (for git operations)                                                                                                                                                                          | `github-actions[bot]@users.noreply.github.com`                  |\n| `push`                         | Define if the changes should be pushed to the branch.                                                                                                                                                                             | true                                                            |\n| `merge`                        | Define if the changes should be pushed even on the pull_request event, immediately merging the pull request.                                                                                                                      | false                                                           |\n| `commit`                       | Define if the changes should be committed to the branch.                                                                                                                                                                          | true                                                            |\n| `commitizen_version`           | Specify the version to be used by commitizen. Eg: `4.10.0`                                                                                                                                                                        | latest                                                          |\n| `changelog`                    | Create changelog when bumping the version                                                                                                                                                                                         | true                                                            |\n| `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/) |\n| `increment`                    | Manually specify the desired increment {MAJOR,MINOR, PATCH}                                                                                                                                                                       | -                                                               |\n| `check_consistency`            | Check consistency among versions defined in commitizen configuration and version_files                                                                                                                                            | `false`                                                         |\n| `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`                                                         |\n| `debug`                        | Prints debug output to GitHub Actions stdout                                                                                                                                                                                      | `false`                                                         |\n\n## Outputs\n\n| Name                     | Description                                                             |\n| ------------------------ | ----------------------------------------------------------------------- |\n| `version`                | The next version (same as `next_version`, kept for historical purposes) |\n| `next_version`           | Next version                                                            |\n| `next_version_major`     | Only the major version of the next version                              |\n| `next_version_minor`     | Only the minor version of the next version                              |\n| `previous_version`       | Version before the bump                                                 |\n| `previous_version_major` | Only the major version of the previous version                          |\n| `previous_version_minor` | Only the minor version of the previous version                          |\n\nThe new version is also available as an environment variable under `REVISION` or you can access using `${{ steps.cz.outputs.version }}`\n\n## Using SSH with deploy keys\n\n1. Create a [deploy key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#deploy-keys) (which is the SSH **public key**)\n2. Add the **private key** as a [Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) in your repository, e.g: `COMMIT_KEY`\n3. Set up your action\n\n```yaml\nname: Bump version\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  bump-version:\n    if: \"!startsWith(github.event.head_commit.message, 'bump:')\"\n    runs-on: ubuntu-latest\n    name: \"Bump version and create changelog with commitizen\"\n    steps:\n      - name: Check out\n        uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n          ssh-key: \"${{ secrets.COMMIT_KEY }}\"\n      - name: Create bump and changelog\n        uses: commitizen-tools/commitizen-action@master\n        with:\n          push: false\n      - name: Push using ssh\n        run: |\n          git push origin main --tags\n```\n\n## Creating a Github release\n\n```yaml\nname: Bump version\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  bump-version:\n    if: \"!startsWith(github.event.head_commit.message, 'bump:')\"\n    runs-on: ubuntu-latest\n    name: \"Bump version and create changelog with commitizen\"\n    steps:\n      - name: Check out\n        uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n          token: \"${{ secrets.PERSONAL_ACCESS_TOKEN }}\"\n      - name: Create bump and changelog\n        uses: commitizen-tools/commitizen-action@master\n        with:\n          github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}\n          changelog_increment_filename: body.md\n      - name: Release\n        uses: softprops/action-gh-release@v1\n        with:\n          body_path: \"body.md\"\n          tag_name: ${{ env.REVISION }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## Troubleshooting\n\n### Other actions are not triggered when the tag is pushed\n\nThis problem occurs because `secrets.GITHUB_TOKEN` do not trigger other\nactions [by design][by_design].\n\nTo solve it, you must use a personal access token in the checkout and the commitizen steps.\n\nFollow the instructions in [commitizen's documentation][cz-docs-ga].\n\nAlternatively, you can try using the `gh` cli in your github action:\n\n```sh\ngh workflow run \u003cworkflow.yaml\u003e ...\n```\n\n## I'm not using conventional commits, I'm using my own set of rules on commits\n\nIf your rules can be parsed, then you can build your own commitizen rules,\ncreate a new commitizen python package, or you can describe it on the `toml` config itself.\n\n[Read more about customization][cz-custom]\n\n[by_design]: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#example-using-multiple-events-with-activity-types-or-configuration\n[cz-docs-ga]: https://commitizen-tools.github.io/commitizen/tutorials/github_actions/\n[cz]: https://commitizen-tools.github.io/commitizen/\n[cc]: https://www.conventionalcommits.org/\n[semver]: https://semver.org/\n[cz-conf]: https://commitizen-tools.github.io/commitizen/config/\n[cz-custom]: https://commitizen-tools.github.io/commitizen/customization/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommitizen-tools%2Fcommitizen-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommitizen-tools%2Fcommitizen-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommitizen-tools%2Fcommitizen-action/lists"}