From a4fdc6a7bc8309764a77fc4d35177263ef4838d6 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 19 Apr 2026 22:25:57 +0300 Subject: [PATCH 1/2] Enhance CI workflow with coverage reporting and update README badges --- .github/workflows/main.yml | 8 +++++++- README.md | 6 ++++++ pyproject.toml | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c2aea40..cba9107 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,13 @@ jobs: python -m pip install -e .[dev] - name: Run tests - run: python -m pytest -q + run: python -m pytest -q --cov=src/commit_check_mcp --cov-report=xml + + - name: Upload coverage + if: matrix.python-version == '3.12' + uses: codecov/codecov-action@v5 + with: + files: ./coverage.xml build: runs-on: ubuntu-24.04 diff --git a/README.md b/README.md index 843945c..0fb2c88 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # commit-check-mcp +[![PyPI version](https://img.shields.io/pypi/v/commit-check-mcp)](https://pypi.org/project/commit-check-mcp/) +[![Python versions](https://img.shields.io/pypi/pyversions/commit-check-mcp)](https://pypi.org/project/commit-check-mcp/) +[![Build](https://github.com/commit-check/commit-check-mcp/actions/workflows/main.yml/badge.svg)](https://github.com/commit-check/commit-check-mcp/actions/workflows/main.yml) +[![Coverage](https://codecov.io/gh/commit-check/commit-check-mcp/graph/badge.svg)](https://codecov.io/gh/commit-check/commit-check-mcp) +[![MCP server](https://img.shields.io/badge/MCP-server-0A7B83)](https://modelcontextprotocol.io/) + Model Context Protocol (MCP) server for [commit-check](https://github.com/commit-check/commit-check). `commit-check-mcp` exposes `commit-check` as local MCP tools so an MCP client can validate commit messages, branch names, author info, and repository state. diff --git a/pyproject.toml b/pyproject.toml index 76a3886..9d09be2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,8 @@ dynamic = ["version"] [project.optional-dependencies] dev = [ - "pytest>=9.0.0,<10" + "pytest>=9.0.0,<10", + "pytest-cov>=6.0.0,<7" ] [project.scripts] From 6e3b539551a3d00874b1b68980f19c5039d46473 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Sun, 19 Apr 2026 22:29:00 +0300 Subject: [PATCH 2/2] Refactor PR autolabeler workflow configuration --- .github/workflows/labeler.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 924a3fb..2f38fd5 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,22 +1,14 @@ name: PR Autolabeler -on: - pull_request_target: - types: - - opened - - reopened - - synchronize - - edited - permissions: - contents: read + contents: write pull-requests: write +on: + # pull_request event is required for autolabeler + pull_request: + types: [opened, reopened, synchronize] + jobs: - labeler: - runs-on: ubuntu-24.04 - steps: - - uses: actions/labeler@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - sync-labels: true + draft-release: + uses: commit-check/.github/.github/workflows/pr-labeler.yml@main