Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
chore: check for commit messages using commitlint and gh actions (#607)
Browse files Browse the repository at this point in the history
Configured and tested!
  • Loading branch information
SanketDG authored Jul 21, 2020
1 parent 8c12f48 commit 39ddb4d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This action uses commitlint to lint commit messages and check for the required guidelines
# as given by the config file commitlint.config.js

name: Check Commit Messages

on:
pull_request:
branches: [ develop ]

jobs:
check-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/[email protected]
- run: yarn add @commitlint/{config-conventional,cli}
- run: yarn run commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
37 changes: 37 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', 100],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', 100],
'header-max-length': [2, 'always', 100],
'scope-case': [2, 'always', 'lower-case'],
'subject-case': [
2,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case']
],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test'
]
]
}
};

0 comments on commit 39ddb4d

Please sign in to comment.