diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml new file mode 100644 index 000000000..1c67e07d3 --- /dev/null +++ b/.github/workflows/commit-lint.yml @@ -0,0 +1,13 @@ +name: Lint Commit Messages +on: [push, pull_request] + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v4 + with: + helpURL: https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md#commit-conventions \ No newline at end of file diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 000000000..4290f9f0e --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,32 @@ +const Configuration = { + /* + * Resolve and load @commitlint/config-conventional from node_modules. + * Referenced packages must be installed + */ + extends: ['@commitlint/config-conventional'], + /* + * Any rules defined here will override rules from @commitlint/config-conventional + */ + rules: { + 'type-enum': [ + 2, + 'always', + [ + 'Build', + 'Chore', + 'CI', + 'Docs', + 'Feat', + 'Fix', + 'Perf', + 'Refactor', + 'Revert', + 'Style', + 'Test', + ], + ], + 'type-case': [2, 'never', 'lower-case'], + }, +}; + +module.exports = Configuration; \ No newline at end of file