Skip to content

Commit 7b7e26f

Browse files
committed
CircleCI example
1 parent dcb7152 commit 7b7e26f

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,31 @@ $(npm bin)/has-message --sha f81a00
130130

131131
If there is a message in the commit's body the script will exit with code 0. Otherwise it will exit with code 1.
132132

133-
See [commit-message-install-example](https://github.com/bahmutov/commit-message-install-example) repo for an example.
133+
See [commit-message-install-example](https://github.com/bahmutov/commit-message-install-example) repo for an example. Here is CircleCI halting if there is no commit message JSON
134+
135+
```yml
136+
# install tool locally
137+
- run: npm install @cypress/commit-message-install
138+
- run: |
139+
if ! $(npm bin)/has-message; then
140+
echo Stopping early, no commit message
141+
circleci-agent step halt
142+
else
143+
echo All good, found commit message JSON
144+
fi
145+
```
146+
147+
```yml
148+
# install tool globally using Yarn
149+
- run: yarn global @cypress/commit-message-install
150+
- run: |
151+
if ! has-message; then
152+
echo Stopping early, no commit message
153+
circleci-agent step halt
154+
else
155+
echo All good, found commit message JSON
156+
fi
157+
```
134158
135159
## API
136160

0 commit comments

Comments
 (0)