diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 000000000..03a4392a0 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,33 @@ +{ + "extends": [ + "@commitlint/config-conventional" + ], + "rules": { + "type-enum": [ + 2, + "always", + [ + "build", + "bot", + "cassandra", + "ceph", + "ci", + "cockroachdb", + "core", + "docs", + "edgefs", + "nfs", + "test", + "yugabytedb" + ] + ], + "body-leading-blank": [ + 2, + "always" + ], + "footer-leading-blank": [ + 2, + "always" + ] + } +} \ No newline at end of file diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 000000000..07cc07d4d --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,16 @@ +name: Commitlint +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v1.6.0 + with: + configFile: './.commitlintrc.json' + helpURL: https://rook.io/docs/rook/master/development-flow.html#commit-structure