Skip to content

Commit

Permalink
fix: action failing to check footer of a single commit
Browse files Browse the repository at this point in the history
Fixes #187
  • Loading branch information
wagoid committed Sep 11, 2021
1 parent 0e361e0 commit 961b6d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions fixtures/signed-off-by/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'signed-off-by': [2, 'always', 'Signed-off-by:'],
},
}
7 changes: 4 additions & 3 deletions src/action.test.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 })
Expand Down
2 changes: 1 addition & 1 deletion src/gitCommits.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const gitCommits = async (gitOpts) => {

return {
hash,
message,
message: message.replace(commitDelimiter, ''),
}
})

Expand Down

0 comments on commit 961b6d4

Please sign in to comment.