Forem

Harish Aravindan
Harish Aravindan

Posted on

4

GitHub Action for Commit Message Validation

What is it about

Have you been in a situation where commit message does not convey the detail of what the code is intended for?
well we can have a validation for that at the repository itself.

Using GitHub actions we can validate commit messages if they have relevant details like story numbers for which the code is being added and so on.

How it works

have published a GitHub Action that helps in validating https://github.com/marketplace/actions/commit-meessage-check

use this in your workflow as step, with your regex of required validation

here is a sample to check if the message has Jira story id

on: [push]

jobs:
  hello_world_job:
    runs-on: ubuntu-latest
    name: commit-message-validation
    steps:
      - uses: actions/checkout@v3
      - id: foo
        uses: uptownaravi/verify-commit-message-action@v2
        with:
          regex: '(?i)jira-[0-9]{3,}'
Enter fullscreen mode Exit fullscreen mode

commit message success

if not then the job fails with exit code 1

commit check failure

The validation happens on the python file https://github.com/uptownaravi/verify-commit-message-action/blob/main/commitcheck.py

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up