mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 16:06:56 +00:00
parent
8ea34043f2
commit
9e5880e3f8
3 changed files with 10666 additions and 14805 deletions
25431
package-lock.json
generated
25431
package-lock.json
generated
File diff suppressed because it is too large
Load diff
14
package.json
14
package.json
|
|
@ -23,13 +23,13 @@
|
|||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/github": "^4.0.0",
|
||||
"@commitlint/config-angular": "^12.0.0",
|
||||
"@commitlint/config-conventional": "^12.0.0",
|
||||
"@commitlint/config-lerna-scopes": "^12.0.0",
|
||||
"@commitlint/config-patternplate": "^12.0.0",
|
||||
"@commitlint/format": "^12.0.0",
|
||||
"@commitlint/lint": "^12.0.0",
|
||||
"@commitlint/load": "^12.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-jira": "^1.4.1",
|
||||
"commitlint-plugin-jira-rules": "^1.4.0",
|
||||
"conventional-changelog-lint-config-canonical": "^1.0.0",
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ describe('Commit Linter action', () => {
|
|||
cwd = await git.bootstrap('fixtures/conventional')
|
||||
await gitEmptyCommit(cwd, 'message from before push')
|
||||
await gitEmptyCommit(cwd, 'wrong message 1')
|
||||
await gitEmptyCommit(cwd, 'chore(WRONG): message 2')
|
||||
await gitEmptyCommit(cwd, 'wrong message 2')
|
||||
const [, , to] = await getCommitHashes(cwd)
|
||||
await createPushEventPayload(cwd, { before: gitEmptySha, to })
|
||||
updatePushEnvVars(cwd, to)
|
||||
|
|
@ -156,7 +156,7 @@ describe('Commit Linter action', () => {
|
|||
await runAction()
|
||||
|
||||
td.verify(core.setFailed(contains('wrong message 1')), { times: 0 })
|
||||
td.verify(core.setFailed(contains('chore(WRONG): message 2')))
|
||||
td.verify(core.setFailed(contains('wrong message 2')))
|
||||
})
|
||||
|
||||
it('should fail for commit with scope that is not a lerna package', async () => {
|
||||
|
|
@ -551,4 +551,26 @@ describe('Commit Linter action', () => {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('when commit contains signed-off-by message', () => {
|
||||
beforeEach(async () => {
|
||||
cwd = await git.bootstrap('fixtures/conventional')
|
||||
await gitEmptyCommit(
|
||||
cwd,
|
||||
'chore: correct message\n\nsome context without leading blank line\nSigned-off-by: John Doe <john.doe@example.com>',
|
||||
)
|
||||
const [to] = await getCommitHashes(cwd)
|
||||
await createPushEventPayload(cwd, { to })
|
||||
updatePushEnvVars(cwd, to)
|
||||
td.replace(process, 'cwd', () => cwd)
|
||||
td.replace(console, 'log')
|
||||
})
|
||||
|
||||
it('should pass', async () => {
|
||||
await runAction()
|
||||
|
||||
td.verify(core.setFailed(), { times: 0, ignoreExtraArgs: true })
|
||||
td.verify(console.log('Lint free! 🎉'))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue