Skip to content

Commit 56e6f50

Browse files
shenxianpengclaude
andcommitted
feat: settle the report format and stop the comment matcher deleting by title
Comment ownership was decided by `body.startswith("# Commit Check")`, and every match but the newest was deleted. A person opening a comment with that heading would have had it removed with no trace. Comments now carry a hidden `<!-- commit-check-action -->` marker, the way Codecov, SonarQube and CodSpeed identify theirs, and deletion is restricted to comments carrying it. A report from an earlier version has no marker, so it is adopted in place — but only when a bot posted it, since the only other signal is the title a person can type by accident. The header counted two different things at once: failures were counted in checks while "passed" and the total counted scopes, so one commit failing two rules rendered "2 failures · 2 passed (3 scopes)" and the numbers did not reconcile. Counts are now checks throughout — "2 of 4 checks failed" — and the details summary repeats the same total so the two can be checked against each other. The table dropped its Result column: only failed scopes reach the table, so it read ❌ on every row. The title moved to h2 with the project logo beside it, an h1 being louder than anything else in a PR comment, and the footer now names the commit-check version that produced the result, which is the first thing worth knowing when an outcome looks wrong. Smaller things found while reading: - an ImportError from PyGithub made the `except GithubException` clause raise NameError, which propagates past the `except Exception` under it and would have killed a step designed to never be fatal - GITHUB_STEP_SUMMARY was read with os.environ[] at import time, so main.py could not be imported outside Actions - the two details renderers differed only by a branch; the unparsable-output fallback now shows in the report instead of rendering an empty scope - build_result_body had no caller but its own test, and include_footer was never passed False - re and tempfile were imported but unused - GITHUB_REPOSITORY was passed to get_repo() unchecked, which mypy flags once PyGithub types are available The logo ships as PNG in this repository rather than as the SVG on commit-check.com: GitHub proxies comment images through camo, which handles SVG unreliably, and a local asset keeps the report free of a cross-repository dependency. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
1 parent 886cd8e commit 56e6f50

3 files changed

Lines changed: 308 additions & 148 deletions

File tree

‎assets/logo.png‎

4.88 KB
Loading

0 commit comments

Comments
 (0)