Skip to content
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

build(ci): Add conventional commit title check #11520

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/preliminary_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ name: Run Checks

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

permissions:
contents: read
Expand Down Expand Up @@ -70,3 +75,23 @@ jobs:
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
exit 1
fi

title-check:
name: PR Title Format
runs-on: ubuntu-latest
steps:
- shell: python
env:
title: "${{ github.event.pull_request.title }}"
run: |
import re
import os
title = os.environ["title"]
title_re = r"^(feat|fix|build|test|docs|refactor|misc)(\(.+\))?!?: ([A-Z].+)[^.]$"
match = re.search(title_re, title)

if match is None:
print("::error::Please follow conventional commit guidelines in commit titles as described in CONTRIBUTING.md: https://github.com/facebookincubator/velox/blob/main/CONTRIBUTING.md#commit-messages")
exit(1)
else:
exit(0)