Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
[![GitHub marketplace](https://img.shields.io/badge/Marketplace-commit--check--action-blue)](https://github.com/marketplace/actions/commit-check-action)
[![slsa-badge](https://slsa.dev/images/gh-badge-level3.svg?color=blue)](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)

<p align="center">
⭐&nbsp;<strong><a href="https://github.com/commit-check/commit-check-action">Star commit-check/commit-check-action</a>&nbsp;— it helps others find us!</strong>
</p>

A GitHub Action for checking commit message formatting, branch naming, committer name, email, commit signoff, and more.

## What's New in v2
Expand Down
12 changes: 10 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
# Constants for message titles
SUCCESS_TITLE = "# Commit-Check ✔️"
FAILURE_TITLE = "# Commit-Check ❌"
STAR_CTA = (
"\n---\n"
'<p align="center">\n'
' ⭐ <strong><a href="https://github.com/commit-check/commit-check-action">'
"Star commit-check/commit-check-action</a>"
" &mdash; if this saved you time, help others find it!</strong>\n"
"</p>\n"
)
COMMIT_MESSAGE_DELIMITER = "\x00"
COMMIT_SECTION_SEPARATOR = "\n---\n"

Expand Down Expand Up @@ -228,8 +236,8 @@ def read_result_file() -> str | None:
def build_result_body(result_text: str | None) -> str:
"""Create the human-readable result body used in summaries and PR comments."""
if result_text is None:
return SUCCESS_TITLE
return f"{FAILURE_TITLE}\n```\n{result_text}\n```"
return f"{SUCCESS_TITLE}\n{STAR_CTA}"
return f"{FAILURE_TITLE}\n```\n{result_text}\n```\n{STAR_CTA}"
Comment on lines +239 to +240
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Update output-contract tests for build_result_body after CTA append.

This changes the result-body contract; tests asserting exact success output (build_result_body(None) == SUCCESS_TITLE) will now fail and should be updated to include/assert STAR_CTA in both success and failure paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@main.py` around lines 239 - 240, Tests that assert the exact output of
build_result_body need to be updated because SUCCESS_TITLE and FAILURE_TITLE
outputs now have STAR_CTA appended; change expectations to include STAR_CTA
(e.g., expect build_result_body(None) to equal SUCCESS_TITLE plus "\n" plus
STAR_CTA) and for failures expect FAILURE_TITLE + "\n```\n" + result_text +
"\n```\n" + STAR_CTA; update any test helpers or fixtures that compare raw
SUCCESS_TITLE or FAILURE_TITLE to instead compare the full string returned by
build_result_body so assertions match the new contract.



def add_job_summary() -> int:
Expand Down
Loading