GeezerVison is showing github.com — fix: never run the checkout's pip.py, reject non-boolean inputs, check empty messages by shenxianpeng · Pull Request #331 · commit-check/commit-check-action
Conversation
Five small fixes to the Action.
1. A pip.py or venv.py in the checkout no longer runs
The install step ran python3 -m venv and python3 -m pip from the caller's checkout. python -m puts the current directory first on sys.path, so a pip.py or venv.py at the repository root ran instead, with this step's GITHUB_TOKEN. With the pull_request_target setup in docs/fork-pr-comments.md, that is a fork's code with a write token. Now every python -m in the install step runs with -I (isolated mode). The self-test plants both files before uses: ./, so the job fails if this ever comes back.
Before / after, in a directory holding pip.py:
$ python3 -m pip --version
PWNED pip.py ran
$ python3 -I -m pip --version
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.13)
2. A boolean input that is not true or false fails the step
message: yes, branch: on or a typo used to read as false and turned the check off without a word. Now true and false in any case are accepted, and anything else stops the step before any check runs:
# before: MESSAGE=yes
✔ commit-check: all checks passed
# after: MESSAGE=yes
::error::Input message must be true or false, got 'yes'
3. A commit with an empty message is checked as empty
The git log listing dropped such a commit, and an empty message piped to the CLI reads as no input, so the CLI checked HEAD (the merge commit) in its place. The commit is now kept, and its empty message goes to the CLI as an empty file, where allow_empty_commits judges it. With the default (allow_empty_commits = true) it still passes.
A pull request with an empty-message commit and allow_empty_commits = false:
# before
::warning title=commit-check::Only 1 of the pull request's 2 commits could be listed (...); the others were not checked
✔ Commit 1/1 (f44db50) (feat: two)
✔ commit-check: all checks passed
# after
✖ Commit 1/2 (aef45af) (1 failure)
✔ Commit 2/2 (f44db50) (feat: two)
::error title=CC008 allow-empty-commits::Commit 1/2 (aef45af): Empty commit messages are not allowed
✖ commit-check: 1 of 2 checks failed
4. Only the Action's own comments are edited or deleted
Comment cleanup matched the <!-- commit-check-action --> marker alone, so a person's comment that quoted a report could be overwritten or deleted. A marked comment now also has to be posted by a bot.
5. PR comments use GITHUB_API_URL
The PR comment client had no base_url, so on GitHub Enterprise Server the comment went to api.github.com and failed. It now uses GITHUB_API_URL, like the other API calls.
Tests
pytest main_test.py: 291 passed. New tests cover the boolean inputs, the empty message, a human comment carrying the marker, and the API URL. Also ran action.yml end to end in a workspace holding pip.py and venv.py (install and check pass, neither file runs), and main.py against a real repository with an empty-message commit (the before/after above).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
… to own comments
- Run venv and pip with python -I, so a pip.py or venv.py at the
repository root no longer runs in their place with GITHUB_TOKEN.
The self-test plants both files to keep it that way.
- A boolean input that is neither true nor false (yes, on, a typo)
now fails the step with the input's name; it used to turn the
check off silently.
- Only edit or delete a marked comment when a bot posted it.
- Send the PR comment to GITHUB_API_URL, as the other API calls do,
so it works on GitHub Enterprise Server.
coderabbitai
Bot
commented
Nov 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 46 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
44a3127a-fde7-4d5a-b4d0-da44d84f7bef
Commits
-
Reviewing files that changed from the base of the PR and between 73fd34f and d3a1ead.
Files selected for processing: 2
-
Walkthrough
-
The action runs its Python commands in isolated mode. Boolean inputs are normalized and validated before checks run. PR comment selection now requires bot authorship, and the GitHub client uses the configured API URL.
Changes: Isolated Python execution
| Layer / File(s) |
Summary |
Isolated Python commands .github/workflows/commit-check.yml, action.yml |
Python version checking, virtual-environment creation, wheel download, and offline installation use isolated mode. The workflow creates pip.py and venv.py scripts that exit with an error if invoked. |
Input validation and PR comments
| Layer / File(s) |
Summary |
Boolean input validation main.py, main_test.py |
Boolean inputs are trimmed and case-normalized. Invalid values are reported before checks run. Tests cover accepted, default, and invalid values. |
PR comment ownership and API URL main.py, main_test.py |
Only bot-authored comments containing the report marker are eligible for selection or deletion. The GitHub client uses GITHUB_API_URL, defaulting to https://api.github.com. Tests cover comment selection and API URL configuration. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related PRs
Suggested labels: bug, ai-assisted
Merge Risk: Low · previous review 73fd3
-
The behavior changes look sound, but a test string trips the spelling check and fails CI. Replace it before merging.
Pre-merge checks: 3 · 2
-
Failed checks: 2 warnings
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
 |
Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
| Title check |
 |
The title describes the isolated Python execution and boolean validation changes, but “check empty messages” does not match the changeset. The title also omits the PR-comment ownership change. |
Replace “check empty messages” with an accurate summary of the PR-comment ownership change, such as “fix: isolate pip and venv, reject invalid boolean inputs, and update only bot comments.” |
Passed checks: 3 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 2 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Commit Check
✅ All 9 checks passed
Show all 9 checks
Pull request
✔ PR title (fix: never run the checkout's pip.py, reject non-boolean ...)
✔ PR description (Five small fixes to the Action.)
Commit message
✔ Commit 1/4 (73fd34f) (fix: never run the checkout's pip.py, reject non-boolean ...)
✔ Commit 2/4 (c8a2398) (fix: check a commit with an empty message as empty, not a...)
✔ Commit 3/4 (3b292b1) (test: avoid a spelling the codespell hook flags)
✔ Commit 4/4 (d3a1ead) (test: use a plain word for the invalid boolean input)
Branch
✔ Branch (fix/action-hardening)
Author
✔ Author name (Xianpeng Shen)
✔ Author email ([email protected])
commit-check 2.20.2 · Rules reference
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Nov 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (dd5f113) to head (d3a1ead).
Additional details and impacted files
@@ Coverage Diff @@
## main #331 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 799 822 +23
=========================================
+ Hits 799 822 +23
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
git log listing dropped such a commit, and piped empty text reads to
the CLI as no input, so it checked HEAD (the merge commit) instead.
The commit is now kept and its empty message goes to the CLI as an
empty file, where allow_empty_commits judges it.
shenxianpeng
changed the title
fix: never run the checkout's pip.py, reject non-boolean inputs, keep to own comments
fix: never run the checkout's pip.py, reject non-boolean inputs, check empty messages
Nov 10, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Labels
bug
Something isn't working
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|