Skip to content

Commit 3751d44

Browse files
shenxianpengclaude
andcommitted
docs: show the report inline instead of linking four missing screenshots
The job summary and PR comment sections pointed at four PNGs under commit-check/.github/screenshot/. That directory does not exist and never has — the repository is five files, and its full history contains no screenshot at any point — so all four have been broken images. They could not have rendered even once. The URLs are /blob/ links, which serve an HTML page rather than an image; Markdown needs raw. githubusercontent.com, as this action's own logo reference already uses. Reproduce the report inline instead. It is Markdown, so GitHub renders it here exactly as it renders it in a job summary — a table and a collapsed tree, not a picture of one — which keeps it accurate for free, selectable, searchable and readable by a screen reader. Two examples rather than four: render_job_summary and render_pr_comment both return render_report, so the surfaces cannot differ, and the comment section now says so and links up rather than repeating itself. Both examples were generated by calling the renderer, not written by hand. Two deliberate departures, both noted in the text: the title is bold rather than a heading, so it stays out of this page's table of contents, and the footer says <version> rather than pinning one that would drift. The comment section also describes the lifecycle, which no screenshot could: the comment is edited in place and survives a passing run, older marked duplicates are deleted, and a pre-marker comment is adopted only when a bot posted it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
1 parent b97366c commit 3751d44

1 file changed

Lines changed: 80 additions & 9 deletions

File tree

‎README.md‎

Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -231,25 +231,96 @@ or gate on individual rules.
231231

232232
## GitHub Action Job Summary
233233

234-
By default, commit-check-action results are shown on the job summary page of the workflow.
234+
By default, commit-check-action results are shown on the job summary page of the
235+
workflow. The report below is reproduced as the action renders it, except that
236+
its title is a heading in the real thing — it is bold here so it stays out of
237+
this page's table of contents — and the footer names the version that actually
238+
ran.
235239

236240
### Success Job Summary
237241

238-
![Success job summary](https://github.com/commit-check/.github/blob/main/screenshot/success-job-summary.png)
242+
Passing runs stay to one line, with the detail folded away:
239243

240-
### Failure Job Summary
244+
> <img src="https://raw.githubusercontent.com/commit-check/commit-check-action/main/assets/logo.png" width="20" align="top" alt=""> **Commit Check**
245+
>
246+
> ✅ **All 3 checks passed**
247+
>
248+
> <details>
249+
> <summary>Show all 3 checks</summary>
250+
>
251+
> ```text
252+
> Commit message
253+
> ✔ PR title (feat: add login page)
254+
> ✔ Commit 1/2 (feat: add login page)
255+
> Branch
256+
> ✔ Branch (feature/add-login)
257+
> ```
258+
>
259+
> </details>
260+
>
261+
> _commit-check &lt;version&gt; · [Rules reference](https://commit-check.com/rules/)_
241262

242-
![Failure job summary](https://github.com/commit-check/.github/blob/main/screenshot/failure-job-summary.png)
263+
### Failure Job Summary
243264

244-
## GitHub Pull Request Comments
265+
Failures open with a count, then a table of only the scopes that failed — every
266+
rule ID links to its documentation — with the full tree still one click away:
245267

246-
### Success Pull Request Comment
268+
> <img src="https://raw.githubusercontent.com/commit-check/commit-check-action/main/assets/logo.png" width="20" align="top" alt=""> **Commit Check**
269+
>
270+
> ❌ **2 of 4 checks failed**
271+
>
272+
> | Scope | Checked value | Failed checks |
273+
> |---|---|---|
274+
> | Commit 2/2 | `bad msg` | [CC001 message](https://commit-check.com/rules/#cc001) |
275+
> | Branch | `my-changes` | [CC201 branch](https://commit-check.com/rules/#cc201) |
276+
>
277+
> <details>
278+
> <summary>Show all 4 checks</summary>
279+
>
280+
> ```text
281+
> Commit message
282+
> ✔ PR title (feat: add login page)
283+
> ✔ Commit 1/2 (feat: add login page)
284+
> ✖ Commit 2/2 (1 failure)
285+
> CC001 message
286+
> value: bad msg
287+
> The commit message should follow Conventional Commits.
288+
> Suggest: Use <type>(<scope>): <description>
289+
> Branch
290+
> ✖ Branch (1 failure)
291+
> CC201 branch
292+
> value: my-changes
293+
> The branch should follow Conventional Branch.
294+
> Suggest: Use <type>/<description> with allowed types
295+
> ```
296+
>
297+
> </details>
298+
>
299+
> _commit-check &lt;version&gt; · [Rules reference](https://commit-check.com/rules/)_
247300

248-
![Success pull request comment](https://github.com/commit-check/.github/blob/main/screenshot/success-pr-comments.png)
301+
A scope is one thing that was checked — a commit message, the branch, the author
302+
— not one rule evaluation, so the total matches the ✔/✖ lines you can count and
303+
does not grow with the number of rules in your config.
249304

250-
### Failure Pull Request Comment
305+
## GitHub Pull Request Comments
251306

252-
![Failure pull request comment](https://github.com/commit-check/.github/blob/main/screenshot/failure-pr-comments.png)
307+
With `pr-comments: true` the same report is posted as a pull request comment.
308+
It is the same Markdown: the job summary and the comment are both rendered by
309+
`render_report`, so the two surfaces cannot disagree. See
310+
[Success Job Summary](#success-job-summary) and
311+
[Failure Job Summary](#failure-job-summary) above for what it looks like.
312+
313+
What differs is the lifecycle rather than the content:
314+
315+
- The comment is **edited in place** on later runs rather than added to, so a
316+
pull request carries one Commit Check comment however many times CI runs. It
317+
stays after the checks pass, showing the ✅ report rather than disappearing.
318+
- Comments are identified by a hidden `<!-- commit-check-action -->` marker, so
319+
reformatting the visible text does not orphan the previous one. If several
320+
marked comments somehow exist, the newest is kept and the rest deleted.
321+
- A comment from a version predating the marker is adopted rather than
322+
duplicated — but only when a bot posted it, since the older signal was just a
323+
title prefix that a person could type by hand.
253324

254325
## Fork PR Comments
255326

0 commit comments

Comments
 (0)