5
0
Fork 0
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:
Manav Tidhan 2022-05-24 14:40:05 +00:00
parent 296247dfa6
commit be21bd3899

View file

@ -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 dont have a ticket for this/g);
if ( jiraRegex != null || jiraIgnoreRegex != null) {
return [true];
}
return [false, 'The body doesnot have Jira ID OR ignore quote'];
},
],
},
}