Skip to content

Commit d0bc75a

Browse files
committed
docs(readme): Update readme to reflect current state
1 parent 15a3315 commit d0bc75a

File tree

1 file changed

+94
-33
lines changed

1 file changed

+94
-33
lines changed

README.md

Lines changed: 94 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,49 @@ I just wanted something simple that works, not configure all kinds of things jus
2020

2121
* Checks for header syntax
2222
* Checks for common typos on the most important keywords: fix, feat and BREAKING CHANGE
23-
* Supports creating pull github pull request reviews
23+
* Supports creating github pull request reviews
2424
* Supports request for changes (default)
2525
* Supports commenting only
2626
* Supports linting only the current commit
2727
* Supports linting all commits
2828
* Supports linting only most recent commits from base branch
29+
* All flags have a corresponding environment variable
30+
* Linux, Mac & Windows
31+
* Github action
2932

3033
## How it works
3134

32-
convcommitlint will check your commits against the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard, and let you know if there are any issues, when running on github actions and if you enable creation of pull request reviews it will create a pull request review for you.
35+
convcommitlint will check your commits against the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard, and let you know if there are any issues, when using the github actior or if you enable the creation of pull request reviews it will create a pull request review for you, with all the findings
3336

34-
## Installation
37+
## Usage
38+
39+
```
40+
Usage:
41+
convcommitlint [flags]
42+
convcommitlint [command]
43+
44+
Available Commands:
45+
completion Generate the autocompletion script for the specified shell
46+
help Help about any command
47+
version Print convcommitlint version
48+
49+
Flags:
50+
-b, --base-branch string The base branch to check commits from (default "main")
51+
--comment-only Pull request reviews will only comment instead of requesting changes
52+
-r, --create-review Creates review on github pull request
53+
-c, --current Lint only the current commit
54+
-h, --help help for convcommitlint
55+
-a, --lint-all Lint all repository commits
56+
-p, --path string Git repository path (default "./")
57+
--pr-number int The number of pull request to create the review
58+
--repository string The github repository in owner/name format ex: coolapso/convcommitlint
59+
60+
Use "convcommitlint [command] --help" for more information about a command.
61+
```
62+
63+
All flags have a corresponding envrionment variable, environment variables are set with `CONVCOMMITLINT` prefix, undresdcore `_` and capitals, example, the `--lint-all` flag becomes `CONVCOMMITLINT_LINT_ALL`
3564

36-
### Github action
65+
## Github action
3766

3867
Github action is available to use with your CI pipelines and most arguments from the CLI application are available.
3968

@@ -45,10 +74,68 @@ Github action is available to use with your CI pipelines and most arguments from
4574
- uses: coolapso/convcommitlint@v0
4675
```
4776

48-
You can find the available inputs in the [action.yaml](action.yaml) file, if a input is not available you still should be able to use it by setting the associated ENV variable.
77+
### Base Branch
78+
79+
convcommitlint needs to know which branch is the base branch to only analize commits between the base branch tip and current HEAD. By default this "main" but if you have a different default branch, you can change it by setting the `base-branch` input
80+
81+
```
82+
convcommitlint:
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v4
86+
- uses: coolapso/convcommitlint@v0
87+
with:
88+
base-branch: develop
89+
```
90+
91+
92+
### git history depth
93+
94+
By default this action will checkout the reference branch and all its history, to controll this behavior you can set the `fetch-depth` to a value you feel comfortable with, just keep in mind that any comits beyond that won't be analized.
95+
96+
```
97+
convcommitlint:
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v4
101+
- uses: coolapso/convcommitlint@v0
102+
with:
103+
fetch-depth: 10
104+
```
105+
106+
### Disable pull request revies
49107

50-
> [!IMPORTANT]
51-
> Be sure to include the Checkout in your workflow, this action won't do it for you!
108+
Creating pull requests is enabled by default in the github action, to disable this behavior set the `create-review` intput to false
109+
110+
```
111+
convcommitlint:
112+
runs-on: ubuntu-latest
113+
steps:
114+
- uses: actions/checkout@v4
115+
- uses: coolapso/convcommitlint@v0
116+
with:
117+
create-review: "false"
118+
```
119+
120+
### Use a specific version of convcommitlint
121+
122+
By default the action will always grab the latest release, If you wish you can pin the version of convcommitlint you want to use
123+
124+
```
125+
convcommitlint:
126+
runs-on: ubuntu-latest
127+
steps:
128+
- uses: actions/checkout@v4
129+
- uses: coolapso/convcommitlint@v0
130+
with:
131+
version: v0.2.0
132+
```
133+
134+
### Other features and flags
135+
136+
This action supports all features and flags from the CLI tool, you can find the available inputs in the [action.yaml](action.yaml) file, if a input is not available you still you can set the flag corresponding environment variable
137+
138+
## Installation
52139

53140
### Docker
54141

@@ -103,32 +190,6 @@ curl -L http://commitlint.coolapso.sh/install.sh | VERSION="v1.1.0" bash
103190
* Execute it
104191

105192

106-
## Usage
107-
108-
```
109-
Usage:
110-
convcommitlint [flags]
111-
convcommitlint [command]
112-
113-
Available Commands:
114-
completion Generate the autocompletion script for the specified shell
115-
help Help about any command
116-
version Print convcommitlint version
117-
118-
Flags:
119-
-b, --base-branch string The base branch to check commits from (default "main")
120-
--comment-only Pull request reviews will only comment instead of requesting changes
121-
-r, --create-review Creates review on github pull request
122-
-c, --current Lint only the current commit
123-
-h, --help help for convcommitlint
124-
-a, --lint-all Lint all repository commits
125-
-p, --path string Git repository path (default "./")
126-
--pr-number int The number of pull request to create the review
127-
--repository string The github repository in owner/name format ex: coolapso/convcommitlint
128-
129-
Use "convcommitlint [command] --help" for more information about a command.
130-
```
131-
132193
## Build
133194

134195
`go build -o convcommitlint

0 commit comments

Comments
 (0)