Skip to content

Commit 958d076

Browse files
committed
fix: label PR title output to avoid confusion with commit messages
When pr-title is enabled and both the PR title and the only commit fail the same check, the output appeared duplicated because the PR title section lacked a label. Now the PR title check always: - Uses --no-banner (banner comes from the commit section when needed) - Prepends a '--- PR Title:' label This makes the output flow consistently: --- PR Title: <error> --- Commit 1/1: <error>
1 parent 275f4d9 commit 958d076

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎main.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,21 @@ def run_commit_check() -> int:
250250

251251
with open("result.txt", "w", encoding="utf-8") as result_file:
252252
# ---- 1. PR title check ------------------------------------------------
253+
# Always label the PR title section and suppress its banner so the
254+
# output flows consistently with the commit-message section labels:
255+
#
256+
# --- PR Title:
257+
# <error details>
258+
# --- Commit 1/1:
259+
# <error details>
253260
if PR_TITLE_ENABLED and is_pr_event():
254261
pr_title = get_pr_title()
255262
if pr_title:
256263
rc = run_check_command(
257-
["--message"],
264+
["--message", "--no-banner"],
258265
result_file,
259266
input_text=pr_title,
267+
output_prefix=f"\n--- PR Title:\n",
260268
)
261269
if rc != 0:
262270
exit_code = max(exit_code, rc)

0 commit comments

Comments
 (0)