feat: add title input for PR comment heading#6
Merged
Affanmir merged 2 commits intoAffanmir:mainfrom Apr 25, 2026
Merged
Conversation
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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an optional
titleinput 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
Changes
action.yml— newtitleinput (optional, default empty)entrypoint.py— passtitleto comment functionsrc/comment.py— accept and forwardtitleto templatetemplates/comment_coverage.md.j2— render title as## headingwhen providedtemplates/comment_quality.md.j2— same for quality modeWhen
titleis empty (default), behavior is unchanged — no heading rendered.