commit-watch v2.1.1
CommitWatch
Overview
CommitWatch checks commit messages and ensures they conform to the conventional commit spec.
Getting Started
You can install the commit-watch package from npm as a dev dependency:
npm i --save-dev commit-watchor
yarn add -d commit-watchOr just run it directly in CI via npx commit-watch or yarn dlx commit-watch.
Before running commit-watch, you need to ensure the relevant environment variables are set. For a full list of required and optional environment variables, see the section below.
Environment Variables:
| Name | Value | Description |
|---|---|---|
| COMMITWATCH_GITHUB_TOKEN | Required | Personal access token with write access to GitHub status checks, and read access to your repository. |
| CI_REPO_OWNER | Required | The "owner" from https://github.com/\<owner>/\<name>. |
| CI_REPO_NAME | Required | The "name" from https://github.com/\<owner>/\<name>. That is, your repository name. |
| CI_COMMIT_SHA | Required | The commit sha to run the linter against. |
| CI_BASE_BRANCH | Defaults to origin/master. | The base branch to compare the commit sha against. |
| COMMIT_WATCH_OUTPUT_DIR | Defaults to ./artifacts/test_results/commitwatch/. | Directory to write the junit report to. |
| COMMIT_WATCH_OUTPUT_FILENAME | Defaults to commitwatch.junit.xml. | The name of the junit report. |
| VERBOSE | Defaults to 0. | Whether to enable verbose mode. |
Contributing
Ensure you are using the correct version of node. It should match the version specified in .nvmrc. You can use a tool such as nvm to automate this process.
Install packages:
yarnTo install the git hooks:
yarn husky installTo run tests:
yarn testAnd watch mode:
yarn test:watchYou can build the package via:
yarn buildSet the CI=1 env variable to generate a test coverage report.
Feel free to open a PR or GitHub issue. Contributions welcome!
License
CommitWatch is licensed under Apache License Version 2.0.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago