Skip to content

Commit 961b6d4

Browse files
committed
fix: action failing to check footer of a single commit
Fixes #187
1 parent 0e361e0 commit 961b6d4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'signed-off-by': [2, 'always', 'Signed-off-by:'],
5+
},
6+
}

src/action.test.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-env jest */
22
import { git } from '@commitlint/test'
3+
import { describe } from '@jest/globals'
34
import execa from 'execa'
45
import td from 'testdouble'
56
import {
@@ -555,12 +556,12 @@ describe('Commit Linter action', () => {
555556
})
556557
})
557558

558-
describe('when commit contains signed-off-by message', () => {
559+
describe('when commit contains required signed-off-by message', () => {
559560
beforeEach(async () => {
560-
cwd = await git.bootstrap('fixtures/conventional')
561+
cwd = await git.bootstrap('fixtures/signed-off-by')
561562
await gitEmptyCommit(
562563
cwd,
563-
'chore: correct message\n\nsome context without leading blank line\nSigned-off-by: John Doe <[email protected]>',
564+
'chore: correct message\n\nsome context without leading blank line.\n\nSigned-off-by: John Doe <[email protected]>',
564565
)
565566
const [to] = await getCommitHashes(cwd)
566567
await createPushEventPayload(cwd, { to })

src/gitCommits.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const gitCommits = async (gitOpts) => {
3333

3434
return {
3535
hash,
36-
message,
36+
message: message.replace(commitDelimiter, ''),
3737
}
3838
})
3939

0 commit comments

Comments
 (0)