5
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2025-11-07 08:06:54 +00:00

Merge pull request #232 from wagoid/fix/signed-off-by-check

fix: action failing to check footer of a single commit
This commit is contained in:
Wagner Santos 2021-09-11 08:35:20 -03:00 committed by GitHub
commit a7a2424bab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1678 additions and 1515 deletions

View file

@ -0,0 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'signed-off-by': [2, 'always', 'Signed-off-by:'],
},
}

3134
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -25,12 +25,12 @@
"@actions/core": "^1.2.6",
"@actions/github": "^5.0.0",
"@commitlint/config-angular": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@commitlint/config-lerna-scopes": "^12.1.4",
"@commitlint/config-patternplate": "^12.1.4",
"@commitlint/format": "^12.1.4",
"@commitlint/lint": "^12.1.4",
"@commitlint/load": "^12.1.4",
"@commitlint/config-conventional": "^13.1.0",
"@commitlint/config-lerna-scopes": "^13.1.0",
"@commitlint/config-patternplate": "^13.1.0",
"@commitlint/format": "^13.1.0",
"@commitlint/lint": "^13.1.0",
"@commitlint/load": "^13.1.0",
"commitlint-config-jira": "^1.5.1",
"commitlint-plugin-function-rules": "^1.3.2",
"commitlint-plugin-jira-rules": "^1.5.1",
@ -40,32 +40,32 @@
"lerna": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7",
"@commitlint/cli": "^12.1.4",
"@commitlint/ensure": "^12.1.4",
"@babel/core": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@commitlint/cli": "^13.1.0",
"@commitlint/ensure": "^13.1.0",
"@commitlint/test": "^9.0.1",
"@commitlint/test-environment": "^9.0.1",
"@jest/globals": "^27.0.6",
"@jest/globals": "^27.1.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.1",
"@rollup/plugin-node-resolve": "^13.0.1",
"babel-jest": "^27.0.6",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"babel-jest": "^27.1.0",
"conventional-changelog-cli": "^2.1.1",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-node": "^4.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"jest": "^27.0.6",
"lint-staged": "^11.0.1",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.2",
"jest": "^27.1.0",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2",
"rollup": "^2.53.2",
"rollup": "^2.56.3",
"standard-version": "^9.3.1",
"testdouble": "^3.16.1",
"testdouble": "^3.16.2",
"yaml": "^1.10.2"
}
}

View file

@ -1,5 +1,6 @@
/* eslint-env jest */
import { git } from '@commitlint/test'
import { describe } from '@jest/globals'
import execa from 'execa'
import td from 'testdouble'
import {
@ -555,12 +556,12 @@ describe('Commit Linter action', () => {
})
})
describe('when commit contains signed-off-by message', () => {
describe('when commit contains required signed-off-by message', () => {
beforeEach(async () => {
cwd = await git.bootstrap('fixtures/conventional')
cwd = await git.bootstrap('fixtures/signed-off-by')
await gitEmptyCommit(
cwd,
'chore: correct message\n\nsome context without leading blank line\nSigned-off-by: John Doe <john.doe@example.com>',
'chore: correct message\n\nsome context without leading blank line.\n\nSigned-off-by: John Doe <john.doe@example.com>',
)
const [to] = await getCommitHashes(cwd)
await createPushEventPayload(cwd, { to })

View file

@ -33,7 +33,7 @@ const gitCommits = async (gitOpts) => {
return {
hash,
message,
message: message.replace(commitDelimiter, ''),
}
})