Skip to content

Commit fd191b7

Browse files
committed
build: only run commit message checks on PRs
Splits out the commit message check so it only runs against pull requests. If an invalid commit has made it into the main branch, we can't do much about it anymore so the failure generates unnecessary noise.
1 parent 2dbbc0d commit fd191b7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.circleci/config.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ jobs:
336336
yarn check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
337337
338338
- run: yarn ng-dev format changed --check << pipeline.git.base_revision >>
339-
- run: yarn ng-dev commit-message validate-range --range << pipeline.git.base_revision >>...<<pipeline.git.revision>>
340339
- run: yarn ownerslint
341340
- run: yarn stylelint
342341
- run: yarn tslint
@@ -345,6 +344,18 @@ jobs:
345344
- *slack_notify_on_failure
346345
- *save_cache
347346

347+
# -------------------------------------------------------------------------------------------
348+
# Job to check that the commit message is formatted correctly.
349+
# -------------------------------------------------------------------------------------------
350+
check_commit_message:
351+
<<: *job_defaults
352+
steps:
353+
- *checkout_code
354+
- *restore_cache
355+
- *yarn_install
356+
357+
- run: yarn ng-dev commit-message validate-range --range << pipeline.git.base_revision >>...<<pipeline.git.revision>>
358+
348359
# -------------------------------------------------------------------------------------------
349360
# Job that builds all release packages. The built packages can be then used in the same
350361
# workflow to publish snapshot builds.
@@ -658,6 +669,10 @@ workflows:
658669
filters: *only_on_pull_requests_filter
659670
requires:
660671
- build_release_packages
672+
- check_commit_message:
673+
# Only run the commit message check on PRs, because if the
674+
# commit made it into the main branch, it's already too late.
675+
filters: *only_on_pull_requests_filter
661676
- lint:
662677
filters: *ignore_presubmit_branch_filter
663678
- ngcc_compatibility:

0 commit comments

Comments
 (0)