Skip to content

Commit

Permalink
ci: don't include PR number is commit linting lenght for titles (#1822)
Browse files Browse the repository at this point in the history
  • Loading branch information
fharper committed Sep 20, 2023
1 parent d1cdbfb commit ed8381f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
6 changes: 0 additions & 6 deletions .commitlint.json

This file was deleted.

17 changes: 17 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const rules = require('@commitlint/rules');

module.exports = {
rules: {
'header-max-length': [2, 'always', 72],
},
plugins: [
{
rules: {
'header-max-length': (parsed, _when, _value) => {
parsed.header = parsed.header.replace(/\s\(#[0-9]+\)$/, '')
return rules.default['header-max-length'](parsed, _when, _value)
},
},
},
]
}
6 changes: 3 additions & 3 deletions .github/workflows/check-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:

steps:
- name: Checkout the code
uses: actions/checkout@main
uses: actions/checkout@v4.0.0
with:
fetch-depth: 0

- name: Lint the commits
uses: wagoid/commitlint-github-action@v5
uses: wagoid/commitlint-github-action@v5.4.3
with:
configFile: .commitlint.json
configFile: .commitlintrc.js
failOnWarnings: true

0 comments on commit ed8381f

Please sign in to comment.