Skip to content

Commit

Permalink
fix: dependabot commits being flaged
Browse files Browse the repository at this point in the history
  • Loading branch information
fadnincx committed Feb 8, 2024
1 parent 4c8f6d5 commit 383fa1d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/configs/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { maxLineLength } = require('@commitlint/ensure')

const bodyMaxLineLength = 100

const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => {
const { type, scope, body } = parsedCommit
const isDepsCommit =
type === 'chore' && scope === 'release'

return [
isDepsCommit || !body || maxLineLength(body, bodyMaxLineLength),
`body's lines must not be longer than ${bodyMaxLineLength}`,
]
}

module.exports = {
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-function-rules'],
rules: {
'body-max-line-length': [0],
'function-rules/body-max-line-length': [
2,
'always',
validateBodyMaxLengthIgnoringDeps,
],
},
}
4 changes: 3 additions & 1 deletion .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
pull_request:
workflow_call:

jobs:
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
with:
configFile: .github/configs/commitlint.config.js

0 comments on commit 383fa1d

Please sign in to comment.