mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 08:06:54 +00:00
style: ignore body-max-line-length rule for deps commits
This commit is contained in:
parent
26b07cb569
commit
cd7f07d5ef
4 changed files with 76 additions and 8 deletions
12
.github/workflows/commitlint.yml
vendored
12
.github/workflows/commitlint.yml
vendored
|
|
@ -10,8 +10,14 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: sed -i -E "s/(docker:.+)/Dockerfile/" ./action.yml
|
- run: sed -i -E "s/(docker:.+)/Dockerfile/" ./action.yml
|
||||||
- run: echo -n '' > .dockerignore
|
- run: echo -n '' > .dockerignore
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- run: npm install
|
||||||
- uses: ./
|
- uses: ./
|
||||||
id: run_commitlint
|
id: run_commitlint
|
||||||
|
env:
|
||||||
|
NODE_PATH: ${{ github.workspace }}/node_modules
|
||||||
- name: Show results from JSON output
|
- name: Show results from JSON output
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: echo ${{ toJSON(steps.run_commitlint.outputs.results) }}
|
run: echo ${{ toJSON(steps.run_commitlint.outputs.results) }}
|
||||||
|
|
@ -21,4 +27,10 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- run: npm install
|
||||||
- uses: ./
|
- uses: ./
|
||||||
|
env:
|
||||||
|
NODE_PATH: ${{ github.workspace }}/node_modules
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,27 @@
|
||||||
|
const { maxLineLength } = require('@commitlint/ensure')
|
||||||
|
|
||||||
|
const bodyMaxLineLength = 100
|
||||||
|
|
||||||
|
const validateBodyMaxLengthIgnoringDeps = parsedCommit => {
|
||||||
|
const { type, scope, body } = parsedCommit
|
||||||
|
const isDepsCommit =
|
||||||
|
type === 'chore' && (scope === 'deps' || scope === 'deps-dev')
|
||||||
|
|
||||||
|
return [
|
||||||
|
isDepsCommit || !body || maxLineLength(body, bodyMaxLineLength),
|
||||||
|
`body's lines must not be longer than ${bodyMaxLineLength}`,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: ['@commitlint/config-conventional'],
|
extends: ['@commitlint/config-conventional'],
|
||||||
|
plugins: ['commitlint-plugin-function-rules'],
|
||||||
|
rules: {
|
||||||
|
'body-max-line-length': [0],
|
||||||
|
'function-rules/body-max-line-length': [
|
||||||
|
2,
|
||||||
|
'always',
|
||||||
|
validateBodyMaxLengthIgnoringDeps,
|
||||||
|
],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
46
package-lock.json
generated
46
package-lock.json
generated
|
|
@ -644,18 +644,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@commitlint/ensure": {
|
"@commitlint/ensure": {
|
||||||
"version": "9.1.2",
|
"version": "11.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-9.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-11.0.0.tgz",
|
||||||
"integrity": "sha512-hwQICwpNSTsZgj/1/SdPvYAzhwjwgCJI4vLbT879+Jc+AJ6sj2bUDGw/F89vzgKz1VnaMm4D65bNhoWhG3pdhQ==",
|
"integrity": "sha512-/T4tjseSwlirKZdnx4AuICMNNlFvRyPQimbZIOYujp9DSO6XRtOy9NrmvWujwHsq9F5Wb80QWi4WMW6HMaENug==",
|
||||||
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@commitlint/types": "^9.1.2",
|
"@commitlint/types": "^11.0.0",
|
||||||
"lodash": "^4.17.19"
|
"lodash": "^4.17.19"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash": {
|
"@commitlint/types": {
|
||||||
"version": "4.17.20",
|
"version": "11.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
|
"resolved": "https://registry.npmjs.org/@commitlint/types/-/types-11.0.0.tgz",
|
||||||
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
|
"integrity": "sha512-VoNqai1vR5anRF5Tuh/+SWDFk7xi7oMwHrHrbm1BprYXjB2RJsWLhUrStMssDxEl5lW/z3EUdg8RvH/IUBccSQ==",
|
||||||
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -901,6 +903,17 @@
|
||||||
"@commitlint/message": "^9.1.2",
|
"@commitlint/message": "^9.1.2",
|
||||||
"@commitlint/to-lines": "^9.1.2",
|
"@commitlint/to-lines": "^9.1.2",
|
||||||
"@commitlint/types": "^9.1.2"
|
"@commitlint/types": "^9.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@commitlint/ensure": {
|
||||||
|
"version": "9.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-9.1.2.tgz",
|
||||||
|
"integrity": "sha512-hwQICwpNSTsZgj/1/SdPvYAzhwjwgCJI4vLbT879+Jc+AJ6sj2bUDGw/F89vzgKz1VnaMm4D65bNhoWhG3pdhQ==",
|
||||||
|
"requires": {
|
||||||
|
"@commitlint/types": "^9.1.2",
|
||||||
|
"lodash": "^4.17.19"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@commitlint/test": {
|
"@commitlint/test": {
|
||||||
|
|
@ -4382,6 +4395,23 @@
|
||||||
"resolved": "https://registry.npmjs.org/commitlint-jira-utils/-/commitlint-jira-utils-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/commitlint-jira-utils/-/commitlint-jira-utils-1.4.0.tgz",
|
||||||
"integrity": "sha512-vW1eGt7cSwtk9I/jOfvxJpDJoSixIn5lq9gI2UOFbidkL4eqAbWFOk/g0NuYVQIF2k/xPZ2yzDr2mXfSCkqAFA=="
|
"integrity": "sha512-vW1eGt7cSwtk9I/jOfvxJpDJoSixIn5lq9gI2UOFbidkL4eqAbWFOk/g0NuYVQIF2k/xPZ2yzDr2mXfSCkqAFA=="
|
||||||
},
|
},
|
||||||
|
"commitlint-plugin-function-rules": {
|
||||||
|
"version": "1.1.20",
|
||||||
|
"resolved": "https://registry.npmjs.org/commitlint-plugin-function-rules/-/commitlint-plugin-function-rules-1.1.20.tgz",
|
||||||
|
"integrity": "sha512-uaWdKa1OI4s0upk0g/sCX2SOgggo+3FCQk7omZxfm0caMj0NgbgEcYulcslFhHRYLc/FjhJfnL2cxPXEldRFWQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@commitlint/types": "11.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@commitlint/types": {
|
||||||
|
"version": "11.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@commitlint/types/-/types-11.0.0.tgz",
|
||||||
|
"integrity": "sha512-VoNqai1vR5anRF5Tuh/+SWDFk7xi7oMwHrHrbm1BprYXjB2RJsWLhUrStMssDxEl5lW/z3EUdg8RvH/IUBccSQ==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"commitlint-plugin-jira-rules": {
|
"commitlint-plugin-jira-rules": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/commitlint-plugin-jira-rules/-/commitlint-plugin-jira-rules-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/commitlint-plugin-jira-rules/-/commitlint-plugin-jira-rules-1.4.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,10 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^11.0.0",
|
"@commitlint/cli": "^11.0.0",
|
||||||
|
"@commitlint/ensure": "^11.0.0",
|
||||||
"@commitlint/test": "^9.0.1",
|
"@commitlint/test": "^9.0.1",
|
||||||
"@commitlint/test-environment": "^9.0.1",
|
"@commitlint/test-environment": "^9.0.1",
|
||||||
|
"commitlint-plugin-function-rules": "^1.1.20",
|
||||||
"conventional-changelog-cli": "^2.1.0",
|
"conventional-changelog-cli": "^2.1.0",
|
||||||
"husky": "^3.1.0",
|
"husky": "^3.1.0",
|
||||||
"jest": "^24.9.0",
|
"jest": "^24.9.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue