Git Product home page Git Product logo

check-conventional-commits-action's Introduction

Check Conventional Commits

This action checks if all the commits of the repository follow the Conventional Commits standard.

Usage

Basic usage:

- uses: asperan/check-conventional-commits-action@main
  with:
    # Personal access token (PAT) used to fetch the repository.
    token: ${{ github.token }}

Use the number of errors detected by the action:

- uses: asperan/check-conventional-commits-action@main
  id: check-commit
  with:
    token: ${{ github.token }}

- uses: marocchino/sticky-pull-request-comment@v2
  # When the previous steps fails, the workflow would stop. By adding this
  # condition you can continue the execution with the populated error message.
  if: always() && (steps.check-commit.outputs.rows != 0)
  with:
    header: pr-title-lint-error
    message: |
      <<any message you want>>

# Delete a previous comment when the issue has been resolved
- uses: marocchino/sticky-pull-request-comment@v2
  if: ${{ steps.check-commit.outputs.rows == 0 }}
    with:
      header: pr-title-lint-error
      delete: true

How to change commit messages after a push

  1. Be sure you are the only one who will make the changes!
  2. In your local copy of the repository, in the faulty branch, run git rebase -i <pull-request-target>; this will open the editor and let you view all the commits between the HEAD of the branch and the destination of the pull-request. In each faulty commit message, change the action to edit and the message to a conventional one; then save and quit from the editor.
  3. You probably need to run git rebase --continue, maybe more than one time, surely until you see a message like Successfully rebased and updated refs/heads/<faulty-branch>.
  4. If you run git status, it should say that your branch and the remote branch are divergent. This is ok, as you have changed messages.
  5. Now you can run git push --force-with-lease, which should not fail (as you are the only one which changed the commits), and the pull request will be updated accordingly.

check-conventional-commits-action's People

Contributors

asperan avatar daniele-tentoni avatar

Watchers

 avatar

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.