Skip to content
Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

GitHub Actions status

Check Commit Message

Action to check if the commit follows proper guidelines as specified here

Usage

Create a workflow .yml file in your repositories .github/workflows directory (eg. .github/workflows/check-commit.yml). In your workflow you first need to checkout your repository then use this action.

Refer to the example below,

name: Check Commit Message

on: [pull_request, push]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Check commit
        uses: adityaa30/check-commit@master

Input Parameters

  • compulsory-scope

    • Either 'true' or 'false'
    • Defaults to 'false'
    • If true, scope field becomes compulsory for each commit (refer here)
  • max-header-length

    • Should be a valid non-zero positive integer
    • Defaults to 50
    • Raises an error if length of commit header is more than specified

Project Installation

Fork the repository

# Clone the forked repository
git clone https://github.com/<git-username>/check-commit.git

# Enter project directory
cd check-commit

# Install dependencies
npm install

# Build the project
npm run build

NOTE

  • Before pushing any changes, please build the project to update the dist/index.js in order to reflect your changes in github
  • To test the project in your local use act

TODO

  • Get the commit message
  • Implement rules based on syntax defined here
  • Helper functions to check commit message based on rules
  • Add input parameter compulsory-scope
  • Add input parameter max-header-length
  • Add a CLI
  • Add custom input parameters

About

Github Action to check if the commit follows proper syntax πŸ˜‰

Topics

Resources

License

Packages

No packages published
You can’t perform that action at this time.