-
Notifications
You must be signed in to change notification settings - Fork 753
ci: EXPOSED-725 Enforce commit message rules #2396
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
Conversation
108a4b4 to
fe677fd
Compare
297dd42 to
2f9f9f3
Compare
c9c269f to
b0c1d74
Compare
b0c1d74 to
fc8df84
Compare
fc8df84 to
b767234
Compare
429575f to
30c9614
Compare
1. Added `commit-message-validation.yml` that runs a bash script to check the commit messages using a regular expression. The `validate-commits` job will run when the pull request is first opened and on every push. 2. Added `pull-request-title-validation.yml` that runs a bash script to check the pull request's title using a regular expression. The `validate-PR-title` job will run on every edit of the pull request. It's not possible to isolate this to title edits only at the moment, so edits to other parts like the body and labels will also trigger this workflow.
30c9614 to
5e46cbd
Compare
|
In general I like that idea, I also sometimes forget about it) Just to confirm, if a PR has several commits, that rule for commit message would be applied only to the last one, right? And there is a moment when we merge the PR. We could squash commits and update the message, that rules wouldn't applied to the new message? |
No, it would apply to all the commits.
Yes, when using "Squash and merge", it is possible to modify the final commit message to something that does not conform to the rules, but this is not something within our control and we cannot enforce it with GitHub Actions as far as I know. There could be something in the repository settings that allows us to do this, but I do not have access to them. Do you? @obabichevjb |
Detailed description:
Ensure that all commit messages in a pull request, including the pull request's title, adhere to the Conventional Commits specification.
The commit message rule is being forgotten sometimes, so it's better to automate this check. Ensuring we adhere to the Conventional Commits specification makes it easier to categorize the commits when preparing the ChangeLog for the release.
commit-message-validation.ymlthat runs a bash script to check the commit messages using a regular expression. Thevalidate-commitsjob will run when the pull request is first opened and on every push.pull-request-title-validation.ymlthat runs a bash script to check the pull request's title using a regular expression. Thevalidate-PR-titlejob will run on every edit of the pull request. It's not possible to isolate this to title edits only at the moment, so edits to other parts like the body and labels will also trigger this workflow.What you'll see when all commit messages are valid:

What you'll see when some commit messages are invalid:

What you'll see when the PR title is valid:

What you'll see when the PR title is invalid:


Example 1
Example 2
Type of Change
Please mark the relevant options with an "X":
Updates/remove existing public API methods:
Affected databases:
Checklist
Related Issues