Skip to content

Commit

Permalink
github: config: Add action to lint PR commits
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonhpr committed May 7, 2020
1 parent dfc2ac5 commit ea395d7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Commitlint

on:
pull_request:
branches: [ master ]

jobs:
commitlint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 20
- uses: wagoid/commitlint-github-action@v1.6.0
with:
configFile: ./commitlint.config.js
45 changes: 45 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
parserPreset: '@commitlint/config-conventional',
rules: {
'body-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 50],
'body-max-line-length': [2, 'always', 72],
'footer-max-line-length': [2, 'always', 72],
'footer-leading-blank': [1, 'always'],
'scope-max-length': [2, 'always', 0],
'subject-case': [
2,
'always',
['sentence-case', 'lower-case']
],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'signed-off-by': [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',
'thing',
'user',
'amqp',
'handler',
'server',
'config',
'github',
]
]
}
};

0 comments on commit ea395d7

Please sign in to comment.