You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Supports linting only most recent commits from base branch
29
+
* All flags have a corresponding environment variable
30
+
* Linux, Mac & Windows
31
+
* Github action
29
32
30
33
## How it works
31
34
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
33
36
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
--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`
35
64
36
-
###Github action
65
+
## Github action
37
66
38
67
Github action is available to use with your CI pipelines and most arguments from the CLI application are available.
39
68
@@ -45,10 +74,68 @@ Github action is available to use with your CI pipelines and most arguments from
45
74
- uses: coolapso/convcommitlint@v0
46
75
```
47
76
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
49
107
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
0 commit comments