Skip to content

ci: Add method for checking conventional commit status #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

polds
Copy link
Collaborator

@polds polds commented Jul 22, 2025

This PR adds a Github Actions workflow that runs after merge to ensure that the commit that was just merged adheres to the conventional commit message format. Because Github allows modifying the commit message prior to merge it's infeasible to have add a commit message check to pre-commit.

This was the best I came up with 🤷🏼‍♂️. It checks if the commit added follows the standard. If it does not, and was authored by a Human, it opens a new issue and assigns the Human that is attributed with the commit message.

@polds polds marked this pull request as ready for review July 22, 2025 02:11
@Copilot Copilot AI review requested due to automatic review settings July 22, 2025 02:11
@polds polds requested a review from a team as a code owner July 22, 2025 02:11
@polds polds enabled auto-merge (squash) July 22, 2025 02:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a post-merge GitHub Actions workflow to enforce conventional commit message format on the main branch. Since GitHub's squash and merge feature allows modifying commit messages, this provides enforcement after merge by checking human-authored commits and creating issues for violations.

  • Adds a GitHub Actions workflow that validates commit messages against conventional commit patterns
  • Implements bot detection to skip automated commits from tools like Dependabot and Release Please
  • Creates comprehensive documentation explaining the workflow and conventional commit requirements

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/commit-message-enforcement.yaml Main workflow that checks commit authors, validates message format, and triggers issue creation
.github/workflows/README.md Documentation explaining the workflow purpose, conventional commit format, and bot detection logic
.github/scripts/create-commit-issue.js Script that creates detailed GitHub issues for commit message violations with formatting guidelines

Copy link
Contributor

@scheibinger scheibinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it opens a new issue and assigns the Human that is attributed with the commit message.

I don't follow the process here.
Why don't we just validate the PR title which can be done with some 3rd party actions like this one: https://github.com/amannn/action-semantic-pull-request

@polds
Copy link
Collaborator Author

polds commented Jul 22, 2025

it opens a new issue and assigns the Human that is attributed with the commit message.

I don't follow the process here. Why don't we just validate the PR title which can be done with some 3rd party actions like this one: https://github.com/amannn/action-semantic-pull-request

Because Github allows modifying the commit message prior to merge it's infeasible to have add a commit message check to pre-commit.

^ this. It doesn’t seem like that action will prevent changing the commit message before merging, which GitHub allows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants