Skip to content

Commit

Permalink
feat(repo): correctly validate revert commits
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Dec 28, 2019
1 parent a0a2a6d commit b04b18d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/commit-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ const gitMessage = require('child_process')
const matchCommit = /(chore|feat|fix|cleanup|docs)\((angular|bazel|core|docs|nextjs|node|react|storybook|testing|repo|misc)\):\s(([a-z0-9:\-\s])+)/g.test(
gitMessage
);
const matchRevert = /Revert/gi.test(gitMessage);
const matchRelease = /Release/gi.test(gitMessage);
const exitCode = +!(matchRelease || matchCommit);
const exitCode = +!(matchRelease || matchRevert || matchCommit);

if (exitCode === 0) {
console.log('Commit ACCEPTED 👌');
Expand Down

0 comments on commit b04b18d

Please sign in to comment.