diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml new file mode 100644 index 0000000..a1b9a79 --- /dev/null +++ b/.github/workflows/commit-check.yml @@ -0,0 +1,25 @@ +name: Commit Check + +on: + pull_request: + branches: 'main' + types: [opened, synchronize, reopened, edited] + workflow_dispatch: + +jobs: + commit-check: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v7.0.0 + with: + fetch-depth: 0 # Required for merge-base checks + - uses: commit-check/commit-check-action@v2.10.0 + with: + message: true + branch: true + job-summary: true + pr-comments: true + pr-title: true diff --git a/commit-check.toml b/commit-check.toml new file mode 100644 index 0000000..3e79b39 --- /dev/null +++ b/commit-check.toml @@ -0,0 +1,34 @@ +# ============================================================================ +# commit-check — org-level base configuration +# +# Repos within the commit-check org can inherit this config by placing the +# following directive at the top of their own commit-check.toml: +# +# inherit_from = "github:commit-check/.github:commit-check.toml" +# +# Local settings override the inherited values (shallow merge per section). +# See https://github.com/commit-check/commit-check for full documentation. +# ============================================================================ + +[commit] +# https://www.conventionalcommits.org +conventional_commits = true +subject_capitalized = false +subject_imperative = true +subject_max_length = 100 +subject_min_length = 5 +allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "ci"] +allow_merge_commits = true +allow_revert_commits = true +allow_empty_commits = false +allow_fixup_commits = true +allow_wip_commits = false +require_body = false +require_signed_off_by = false +ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]", "coderabbitai[bot]"] + +[branch] +# https://conventional-branch.github.io/ +conventional_branch = true +allow_branch_types = ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix", "ai", "claude", "codex", "copilot", "cursor"] +ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]", "shenxianpeng"]