Skip to content

feat: add title input for PR comment heading#6

Merged
Affanmir merged 2 commits intoAffanmir:mainfrom
usama3332:feat/add-title-input
Apr 25, 2026
Merged

feat: add title input for PR comment heading#6
Affanmir merged 2 commits intoAffanmir:mainfrom
usama3332:feat/add-title-input

Conversation

@usama3332
Copy link
Copy Markdown
Contributor

Summary

Add an optional title input that renders as an H2 heading at the top of the PR comment.

Use case

In monorepos where multiple coverage-check jobs run in a matrix, each PR comment needs to identify which app/package it belongs to. Without a title, all comments look identical.

Usage

- uses: Affanmir/diff-cover-action@v2
  with:
    title: partners-app
    coverage-files: coverage/lcov.info
    fail-under: '90'

Changes

  • action.yml — new title input (optional, default empty)
  • entrypoint.py — pass title to comment function
  • src/comment.py — accept and forward title to template
  • templates/comment_coverage.md.j2 — render title as ## heading when provided
  • templates/comment_quality.md.j2 — same for quality mode

When title is empty (default), behavior is unchanged — no heading rendered.

Add optional `title` input that renders as an H2 heading at the top of
the PR comment. Useful in monorepos where multiple coverage-check jobs
run in a matrix and each comment needs to identify which app it belongs to.

Usage:
  - name: Coverage
    uses: Affanmir/diff-cover-action@v2
    with:
      title: partners-app
      coverage-files: coverage/lcov.info

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@usama3332 usama3332 requested a review from Affanmir as a code owner April 23, 2026 07:17
- Add title="" to test_render_comment_body and test_render_comment_body_below_threshold
- Add test_render_comment_body_with_title to verify title renders as heading

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Affanmir Affanmir merged commit 460a38e into Affanmir:main Apr 25, 2026
5 checks passed
@github-actions
Copy link
Copy Markdown

100.0%

████████████████████100.0% on changed lines

0 lines changed   0 uncovered   0 files

 📋 Full diff-cover report

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.

🛡️ diff-cover-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants