Skip to content

About Commitizen github action to check if Pr title follow conventional commits

License

Notifications You must be signed in to change notification settings

CashStory/commitizen-action-pr

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

commitizen-action-pr

Add commitizen incredibly fast into your project!

Features

  • Check Pr title

Are you using conventional commits and semver?

Then you are ready to use this github action, the only thing you'll need is the .cz.toml file in your project.

Usage

  1. In your repository create a .cz.toml file (you can run cz init to create it)
  2. Create a .github/workflows/bumpversion.yaml with the Sample Workflow

Minimal configuration

Your .cz.toml (or pyproject.toml if you are using python) should look like this.

[tool.commitizen]
version = "0.1.0"  # This should be your current semver version

For more information visit commitizen's configuration page

Sample Workflow

name: Pull request validation

on:
  pull_request:
        types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
  bump_version:
    if: "!startsWith(github.event.head_commit.message, 'bump:')"
    runs-on: ubuntu-latest
    name: "Bump version and create changelog with commitizen"
    steps:
      - name: Check out
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
          token: "${{ secrets.GITHUB_TOKEN }}"
      - name: Validate PR title with commitizen
        uses: CashStory/[email protected]

Troubleshooting

I'm not using conventional commits, I'm using my own set of rules on commits

If your rules can be parsed then you can build your own commitizen rules, you can create a new commitizen python package or you can describe it on the toml conf itself.

Read more about customization

About

About Commitizen github action to check if Pr title follow conventional commits

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •