Giter Site home page Giter Site logo

commitizen-action-pr's Introduction

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

commitizen-action-pr's People

Contributors

woile avatar bobcashstory avatar actions-user avatar lee-w avatar

Watchers

James Cloos avatar

Forkers

samifiaz

commitizen-action-pr's Issues

Permissions issue within `entrypoint.sh`

Github secret doesn't seem to have permissions to access the github event path.

Running the action results in this error right after it finishes pip installing everything:

/entrypoint.sh: line 19: /github/workflow/event.json: Permission denied
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Have you seen this error before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.