From 4341743b4a6d7e23c6f944aa9e34166b701369a1 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 20 Apr 2020 19:42:09 +0200 Subject: [PATCH] fix(dev-infra): exit non-zero if commit message validation failed (#36723) Currently the `commit-message` validation script does not exit with a non-zero exit code if the commit message validation failed. This means that invalid commit messages are currently not causing CI to be red. See: https://circleci.com/gh/angular/angular/686008 PR Close #36723 --- dev-infra/commit-message/validate-range.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dev-infra/commit-message/validate-range.ts b/dev-infra/commit-message/validate-range.ts index 4da1f681e2..e79c5df41a 100644 --- a/dev-infra/commit-message/validate-range.ts +++ b/dev-infra/commit-message/validate-range.ts @@ -39,7 +39,12 @@ export function validateCommitRange(range: string) { }; return validateCommitMessage(m, options); }); + if (allCommitsInRangeValid) { console.info('√ All commit messages in range valid.'); + } else { + // Exit with a non-zero exit code if invalid commit messages have + // been discovered. + process.exit(1); } }