diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 0000000..73bb18b --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,13 @@ +{ + "extends": ["@commitlint/config-conventional"], + "rules": { + "type-enum": [ + 2, + "always", + ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "build", "ci", "revert"] + ], + "subject-case": [0, "always"], + "header-max-length": [1, "always", 100] + } +} + diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..2f8dc7f --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,20 @@ +name: Commit Lint +on: + pull_request: + branches: [main, master] +permissions: + contents: read +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Lint commits in PR + uses: wagoid/commitlint-github-action@v6 + with: + configFile: ".commitlintrc.json" + failOnWarnings: false + firstParent: false +