Skip to content

Commit

Permalink
ci: semantic commits check (backport #495) (#496)
Browse files Browse the repository at this point in the history
Co-authored-by: Rucha Mahabal <[email protected]>
  • Loading branch information
mergify[bot] and ruchamahabal authored May 3, 2023
1 parent aeb3cc1 commit fe84912
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,30 @@ on:
pull_request: { }

jobs:
commit-lint:
name: 'Semantic Commits'
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 200
- uses: actions/setup-node@v2
with:
node-version: 16
check-latest: true

linters:
name: linters
- name: Check commit titles
run: |
npm install @commitlint/cli @commitlint/config-conventional
npx commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
linter:
name: 'Frappe Linter'
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v2

Expand Down
25 changes: 25 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'subject-empty': [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 fe84912

Please sign in to comment.