Skip to content

Fix/184#185

Closed
shenxianpeng wants to merge 5 commits intomainfrom
fix/184
Closed

Fix/184#185
shenxianpeng wants to merge 5 commits intomainfrom
fix/184

Conversation

@shenxianpeng
Copy link
Contributor

No description provided.

shenxianpeng and others added 5 commits February 25, 2026 20:44
Removed GITHUB_TOKEN environment variable for self test.
When actions/checkout runs on a pull_request event, it checks out an
auto-generated merge commit at refs/pull/{N}/merge as HEAD. The commit
message of this merge commit is 'Merge {sha} into {base}', which:
- Matches the (Merge).* alternative in the conventional commits regex
- Is allowed by allow_merge_commits = true

This caused the action to always pass on PRs regardless of the actual
commit messages, since only the merge commit HEAD was ever checked.

Fix by adding get_pr_commit_messages() which, when GITHUB_BASE_REF is
set (indicating a PR context), retrieves the real PR commits via:

  git log --no-merges origin/{base_ref}..HEAD --format=%B%x00 --reverse

Each commit message is then piped individually to commit-check --message
via stdin so the actual PR commits are validated.

In non-PR contexts (push, manual dispatch, etc.) the existing behaviour
is preserved: commit-check determines what to check from git itself.

Also fixes stderr being silently discarded (subprocess.PIPE) by using
subprocess.STDOUT so errors are captured in result.txt and surfaced in
the job summary and PR comments.

Fixes #184

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 84b9b7db-ee7a-48d5-b1ae-441954430f6b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/184
📝 Coding Plan
  • Generate coding plan for human review comments

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

@github-actions
Copy link
Contributor

Commit-Check ✔️

@shenxianpeng shenxianpeng deleted the fix/184 branch March 13, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant