Skip to content

Repository files navigation

Commitlint config file

For checking the commit messages, a configuration file (commitlint.config.mjs) with some rules is used, which can be individually adapted. To find out what the rules are about and what rules can be used see:

https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md

Using commitlint in the workflow

# get the correct commitlint configuration file
- name: Get commitlint config
run: |
curl https://raw.githubusercontent.com/fntsoftware/commitlint-config/main/cmd-commitlint.config.mjs \
-o commitlint.config.mjs # use an commitlint github action for linting
- name: Check commit message
uses: wagoid/commitlint-github-action@v6
with:
configFile: commitlint.config.mjs
commitDepth: 1

Structure

<type>(<scope?>): <subject!>
<BLANK LINE>
<body?>
<BLANK LINE>
<footer?>

Setup commitlint for local testing

Install

# install npm dependencies
npm ci
# check if installation was successfull (help message should be shown)
npx commitlint

Testing

echo"feat(scope): new feature"| npx commitlint --config cmd-commitlint.config.mjs

alternatively you can read multiline input from a file:

cat input.txt | npx commitlint --config cmd-commitlint.config.mjs

or check actual commit message and using a separate config file stored at different location:

npx commitlint --from=HEAD~1 --config cmd-commitlint.config.mjs

About

Repository which contains commitlint configuration files

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages