mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 16:06:56 +00:00
feat: added jira rules
This commit is contained in:
parent
296247dfa6
commit
be21bd3899
1 changed files with 12 additions and 0 deletions
|
|
@ -24,5 +24,17 @@ module.exports = {
|
|||
'always',
|
||||
validateBodyMaxLengthIgnoringDeps,
|
||||
],
|
||||
'function-rules/body-jira-id-check': [
|
||||
2, // level: error
|
||||
'always',
|
||||
(parsed) => {
|
||||
const jiraRegex = parsed.body.match(/[A-Z]+[-\d]+/g);
|
||||
const jiraIgnoreRegex = parsed.body.match(/I don’t have a ticket for this/g);
|
||||
if ( jiraRegex != null || jiraIgnoreRegex != null) {
|
||||
return [true];
|
||||
}
|
||||
return [false, 'The body doesnot have Jira ID OR ignore quote'];
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue