diff --git a/.github/config/commitlint.config.js b/.github/config/commitlint.config.js new file mode 100644 index 0000000000..2f1e09f26f --- /dev/null +++ b/.github/config/commitlint.config.js @@ -0,0 +1,21 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + // refer to https://commitlint.js.org/reference/rules-configuration.html#rules-configuration for rule configurations + rules: { + 'subject-case': [0], + 'body-max-line-length': [0], + 'footer-max-line-length': [0], + 'type-enum': [2, 'always', [ + 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', + 'opt', 'internal', 'tests' + ]] + }, + parserPreset: { + parserOpts: { + issuePrefixes: ['#'] + } + }, + ignores: [ + (message) => message.includes('Co-authored-by:') + ] +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77c6d7cad4..60eb56004a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -835,6 +835,15 @@ jobs: cat /tmp/typos.json ! grep -q '[^[:space:]]' /tmp/typos.json + commit-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + submodules: true + - uses: ahmadnassri/action-commit-lint@v2 + with: + config: ./.github/config/commitlint.config.js kani: runs-on: ubuntu-latest strategy: