Add commitlint configuration and compliance checks - #1038
Conversation
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
leonardocarreras
left a comment
There was a problem hiding this comment.
Hi @stv0g! I left some comments here, things are a lot matter of preference, so just wanted to help to the choices.
Then there are additionally some small fixes to future-proof, like Node 20 vs newer.
Just as random fact, the PR title does not comply with the new tool, so failing here proved it works :)
| run: | | ||
| if ! printf '%s\n' "$PR_TITLE" | npx commitlint --verbose; then | ||
| echo "" | ||
| echo "The pull request title becomes the merge commit subject on master." |
There was a problem hiding this comment.
Do you plan to use merge-commits to master? Looks to me that we are using rebase-merge nowadays, at least in the last few PRs I checked
| "build", | ||
| "chore", | ||
| "ci", | ||
| "docs", |
There was a problem hiding this comment.
only docs valid, or also doc makes sense?
| "type-enum": [ | ||
| 2, | ||
| "always", | ||
| [ |
There was a problem hiding this comment.
some commits in history use cleanup, do we want that added?
|
|
||
| - uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: "20" |
There was a problem hiding this comment.
node 20 is deprecated
| node-version: "20" | ||
|
|
||
| - name: Install commitlint | ||
| run: npm install --no-save @commitlint/cli @commitlint/config-conventional |
There was a problem hiding this comment.
should we also pin this as the same version?
| exit 1 | ||
| fi | ||
|
|
||
| - name: Fail if a commit in this branch is not a conventional commit |
There was a problem hiding this comment.
you may think if you want to use wagoid/commitlint-github-action@v6 to shorten this part, it does this iteration by itself
| "sentence-case", | ||
| "start-case", | ||
| "pascal-case", | ||
| "upper-case" |
There was a problem hiding this comment.
for release-please to pass will be needing an addition in
node/release-please-config.json
Line 3 in 88e8a79
something like this might be an option
"pull-request-title-pattern": "chore${scope}: Release${component} ${version}"
No description provided.