From 32001cfdd47d9c27b82ad9eec71c90ed7c0aed7d Mon Sep 17 00:00:00 2001 From: Affan Amir Mir Date: Wed, 29 Apr 2026 10:46:22 +0500 Subject: [PATCH] =?UTF-8?q?docs:=20prep=20v2.1.0=20release=20=E2=80=94=20d?= =?UTF-8?q?ocument=20title=20input=20and=20bump=20version=20refs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documents the title input added in #6 and updates stale @v1 references in README, llms.txt, and the GitHub Pages docs site to point at @v2. - CHANGELOG: add 2.1.0 section for the new title input - README: add Comment Customization input table, monorepo matrix example, and update all @v1 -> @v2 in usage snippets - llms.txt: bump version reference and add monorepo title example - docs/index.html: bump stale @v1 ref in the quick-start snippet Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 5 +++++ README.md | 54 ++++++++++++++++++++++++++++++++++++++----------- docs/index.html | 2 +- llms.txt | 12 ++++++++++- 4 files changed, 59 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f43ed28..360bf7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.1.0] - 2026-04-29 + +### Added +- `title` input — optional H2 heading at the top of the PR comment. Useful in monorepos where a matrix of coverage jobs runs and each comment needs to identify which app or package it belongs to. When unset (default), no heading is rendered and behavior is unchanged. + ## [2.0.0] - 2026-04-08 ### Added diff --git a/README.md b/README.md index 245ffeb..c3e1c5e 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ jobs: pytest --cov --cov-report=xml - name: Diff Coverage - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml fail-under: '80' @@ -191,7 +191,7 @@ jobs: ```yaml - name: Diff Quality - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: mode: quality violations: ruff.check @@ -202,13 +202,13 @@ jobs: ```yaml - name: Diff Coverage - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml fail-under: '80' - name: Diff Quality - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: mode: quality violations: flake8 @@ -274,6 +274,12 @@ jobs: | `fail-under` | Minimum acceptable percentage (0-100) | `0` | | `fail-on-threshold` | Fail the step when below threshold | `true` | +### Comment Customization + +| Input | Description | Default | +|-------|-------------|---------| +| `title` | Optional H2 heading shown at the top of the PR comment (e.g. app name in a monorepo). Empty = no heading. | | + ### GitHub Integration | Input | Description | Default | @@ -307,7 +313,7 @@ jobs: ```yaml - name: Diff Coverage id: coverage - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml @@ -357,7 +363,7 @@ Enable badge generation and use with shields.io: ```yaml - name: Diff Coverage - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml create-badge: 'true' @@ -376,7 +382,7 @@ Then use with a [shields.io endpoint badge](https://shields.io/badges/endpoint-b ### Multiple Coverage Files ```yaml - - uses: Affanmir/diff-cover-action@v1 + - uses: Affanmir/diff-cover-action@v2 with: coverage-files: 'unit-coverage.xml integration-coverage.xml' ``` @@ -384,7 +390,7 @@ Then use with a [shields.io endpoint badge](https://shields.io/badges/endpoint-b ### Glob Patterns ```yaml - - uses: Affanmir/diff-cover-action@v1 + - uses: Affanmir/diff-cover-action@v2 with: coverage-files: '**/coverage*.xml' ``` @@ -392,7 +398,7 @@ Then use with a [shields.io endpoint badge](https://shields.io/badges/endpoint-b ### Exclude Patterns ```yaml - - uses: Affanmir/diff-cover-action@v1 + - uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml exclude: | @@ -404,7 +410,7 @@ Then use with a [shields.io endpoint badge](https://shields.io/badges/endpoint-b ### JaCoCo (Java) ```yaml - - uses: Affanmir/diff-cover-action@v1 + - uses: Affanmir/diff-cover-action@v2 with: coverage-files: target/site/jacoco/jacoco.xml src-roots: 'src/main/java' @@ -413,7 +419,7 @@ Then use with a [shields.io endpoint badge](https://shields.io/badges/endpoint-b ### TOML Configuration ```yaml - - uses: Affanmir/diff-cover-action@v1 + - uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml config-file: pyproject.toml @@ -428,6 +434,30 @@ fail_under = 80 exclude = ["tests/*", "setup.py"] ``` +### Monorepo Matrix (titled comments per app) + +When several coverage jobs run in a matrix, give each comment its own heading and a unique `comment-identifier` so they don't overwrite each other: + +```yaml +jobs: + coverage: + strategy: + matrix: + app: [online-store, cms, partners-app] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: pnpm test:unit:${{ matrix.app }} + - uses: Affanmir/diff-cover-action@v2 + with: + title: ${{ matrix.app }} + coverage-files: apps/${{ matrix.app }}/coverage/lcov.info + comment-identifier: diff-cover-${{ matrix.app }} + fail-under: '80' +``` + +Each PR gets one comment per app, headed with the app name. + ### Conditional Failure Report coverage without failing the step: @@ -435,7 +465,7 @@ Report coverage without failing the step: ```yaml - name: Coverage Report id: coverage - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml fail-under: '80' diff --git a/docs/index.html b/docs/index.html index a64c051..98be398 100644 --- a/docs/index.html +++ b/docs/index.html @@ -289,7 +289,7 @@

Quick Start

pytest --cov --cov-report=xml - name: Diff Coverage - uses: Affanmir/diff-cover-action@v1 + uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml fail-under: '80' diff --git a/llms.txt b/llms.txt index 1691ad2..3ffa86c 100644 --- a/llms.txt +++ b/llms.txt @@ -27,12 +27,22 @@ Any language that produces Cobertura XML, lcov, or JaCoCo coverage reports: Pyth ## Usage ```yaml -- uses: Affanmir/diff-cover-action@v1 +- uses: Affanmir/diff-cover-action@v2 with: coverage-files: coverage.xml fail-under: '80' ``` +In monorepos with a matrix of coverage jobs, set `title` so each PR comment identifies its app, and a unique `comment-identifier` so comments don't overwrite each other: + +```yaml +- uses: Affanmir/diff-cover-action@v2 + with: + title: partners-app + coverage-files: apps/partners-app/coverage/lcov.info + comment-identifier: diff-cover-partners-app +``` + ## Links - [GitHub Repository](https://github.com/Affanmir/diff-cover-action)