ci: only lint commit messages on PRs (#35035)

As all commit messages are linted during the PR process, we
do not need to relint these previous commit messages on upstream
branches.

PR Close #35035
This commit is contained in:
Joey Perrott 2020-01-29 09:06:20 -08:00 committed by Miško Hevery
parent e6cb60ee22
commit c2c4aea97d
1 changed files with 8 additions and 0 deletions

View File

@ -10,6 +10,14 @@
// tslint:disable:no-console
module.exports = (gulp) => () => {
try {
if (process.env['CIRCLECI'] === 'true' && !process.env['CIRCLE_PR_NUMBER']) {
console.info(
`Since commit messages are validated as part of the PR review process,\n` +
`we do not need to commit messages on CI runs on upstream branches.\n\n` +
`Skipping validate-commit-message check`
)
process.exit();
}
const validateCommitMessage = require('../validate-commit-message');
const shelljs = require('shelljs');