1 | <h1 align="center">Welcome to skip-ci 👋</h1>
|
2 |
|
3 | > ✨ Automatically detect [skip ci] messages (and the like) in your last commit 🎉
|
4 |
|
5 | ### 🏠 [Homepage](https://github.com/JaneJeon/dev/tree/master/packages/skip-ci)
|
6 |
|
7 | When you include either a `[skip ci]` or a `[ci skip]` in your commit message, (most) CI systems understand it to mean, well, CI. This is generally useful when you're updating non-code portions of the repo, such as documentation or when you're fixing something irrelevant to the codebase.
|
8 |
|
9 | However, if you're like me, you might use git hooks (perhaps using `husky`) to prevent bad code from being pushed in the first place by making tests run during `pre-push` hook. This generally works great, but it still runs the tests even when you add a `[skip ci]` to your commit message.
|
10 |
|
11 | That's where this tool comes in. Just call `skip-ci` and you'll be able to detect & skip whatever commands you'd like when you don't want to run any tests. To see an example, just look at this repo's `.huskyrc.yml`!
|
12 |
|
13 | ## Install
|
14 |
|
15 | ```sh
|
16 | npm i skip-ci -D
|
17 | ```
|
18 |
|
19 | This package has ZERO dependencies!
|
20 |
|
21 | ## Usage
|
22 |
|
23 | ```sh
|
24 | skip-ci && "Skipping CI..." || echo "Running tests..."
|
25 | ```
|
26 |
|
27 | ## Development
|
28 |
|
29 | Because we rely on a subrepo for testing the `skip-ci` tool, when cloning, make sure you add the `--recursive` flag.
|
30 |
|
31 | Then, you can test `skip-ci` (or more specifically, `cli.js`) by running `npm test`, which will go through each commit of the test repo (`repo/`) and check that the tool recognizes `[skip ci]` and `[ci skip]` and returns the appropriate exit codes.
|
32 |
|
33 | And don't forget to `npm i` when developing to install `devDependencies` (mainly linting).
|
34 |
|
35 | ## Author
|
36 |
|
37 | 👤 **Jane Jeon <git@janejeon.com>**
|
38 |
|
39 | - Website: https://janejeon.dev
|
40 | - Github: [@JaneJeon](https://github.com/JaneJeon)
|
41 |
|
42 | ## 🤝 Contributing
|
43 |
|
44 | Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/JaneJeon/dev/issues).
|
45 |
|
46 | ## Show your support
|
47 |
|
48 | Give a ⭐️ if this project helped you!
|
49 |
|
50 | ## 📝 License
|
51 |
|
52 | Copyright © 2022 [Jane Jeon <git@janejeon.com>](https://github.com/JaneJeon).<br />
|
53 | This project is [LGPL](https://github.com/JaneJeon/dev/tree/master/packages/skip-ci/LICENSE) licensed.
|
54 |
|
55 | TL;DR: you are free to import and use this library "as-is" in your code, without needing to make your code source-available or to license it under the same license as this library; however, if you do change this library and you distribute it (directly or as part of your code consuming this library), please do contribute back any improvements for this library and this library alone.
|