File tree 1 file changed +55
-0
lines changed
1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ This guide assumes you have a already configured `commitlint` for local usage.
6
6
7
7
Follow the [ Getting Started] ( ./?id=getting-started ) for basic installation and configuration instructions.
8
8
9
+ ## Travis
10
+
9
11
``` bash
10
12
# Install and configure if needed
11
13
npm install --save-dev @commitlint/travis-cli
@@ -20,4 +22,57 @@ script:
20
22
- commitlint-travis
21
23
` ` `
22
24
25
+ ## CircleCI
26
+
27
+ It's just a simple example of how CircleCI configuration file could look like to validate last commit message
28
+
29
+ ` ` ` yml
30
+ version : 2
31
+ defaults :
32
+ working_directory : ~/project
33
+ docker :
34
+ - image : circleci/node:latest
35
+
36
+ jobs :
37
+ setup :
38
+ << : *defaults
39
+ steps :
40
+ - checkout
41
+ - restore_cache :
42
+ key : lock-{{ checksum "package-lock.json" }}
43
+ - run :
44
+ name : Install dependencies
45
+ command : npm install
46
+ - save_cache :
47
+ key : lock-{{ checksum "package-lock.json" }}
48
+ paths :
49
+ - node_modules
50
+ - persist_to_workspace :
51
+ root : ~/project
52
+ paths :
53
+ - node_modules
54
+
55
+ lint_commit_message :
56
+ << : *defaults
57
+ steps :
58
+ - checkout
59
+ - attach_workspace :
60
+ at : ~/project
61
+ - run :
62
+ name : Define environment variable with lastest commit's message
63
+ command : |
64
+ echo 'export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")' >> $BASH_ENV
65
+ source $BASH_ENV
66
+ - run :
67
+ name : Lint commit message
68
+ command : echo "$COMMIT_MESSAGE" | npx commitlint
69
+
70
+ workflows :
71
+ version : 2
72
+ commit :
73
+ jobs :
74
+ - setup
75
+ - lint_commit_message : { requires: [setup] }
76
+ ` ` `
77
+
23
78
?> Help yourself adopting a commit convention by using an interactive commit prompt. Learn how to use ` @commitlint/prompt-cli` in the [Use prompt guide](guides-use-prompt.md)
You can’t perform that action at this time.
0 commit comments