Skip to content

Commit

Permalink
ci(travis): include commitlint stage
Browse files Browse the repository at this point in the history
* https://github.com/conventional-changelog/commitlint
  - Lint commit messages.
  - Ensure that they are in accordance with `semantic-release` settings.
  - Use Travis CI to display errors and prevent release stage if so.
* https://conventional-changelog.github.io/commitlint/#/reference-rules
  - Specific rules are defined in `commitlint.config.js`.
  - Using the default rules at the time of this commit.
  - This link gives full details on the default values and how to
    provide custom settings.
  • Loading branch information
myii committed Feb 21, 2019
1 parent 8fca3a9 commit 6659a69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
stages:
- test
- commitlint
- name: release
if: branch = master

sudo: required
cache: bundler
language: ruby
Expand All @@ -22,9 +28,16 @@ before_deploy:
- test $TRAVIS_TEST_RESULT = 0

jobs:
# Only run if this is the `master` branch
if: branch = master
include:
# Define the commitlint stage
- stage: commitlint
language: node_js
node_js: lts/*
before_install: skip
script:
- npm install @commitlint/config-conventional -D
- npm install @commitlint/travis-cli -D
- commitlint-travis
# Define the release stage that runs semantic-release
- stage: release
language: node_js
Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};

0 comments on commit 6659a69

Please sign in to comment.