feat: support Windows runner#219
Conversation
…d and venv activate path - Use variable (python on Windows, python3 on Linux/macOS) - Use for correct venv activation path (venv/Scripts/activate on Windows, venv/bin/activate on Linux/macOS) - Keep DEB_PYTHON_INSTALL_LAYOUT Linux-specific The action now works on all three GitHub-hosted runner OSes: ubuntu-latest, macos-latest, and windows-latest.
Commit-Check ✔️ |
Increase maximum subject length for commit messages.
|
Warning Review limit reached
More reviews will be available in 16 minutes and 47 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesCross-platform action script and config update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Run the self-test workflow on both ubuntu-latest and windows-latest to validate Windows compatibility. PR comments are only posted from the ubuntu job to avoid duplicates.
…lity On Windows, Python's default encoding is cp1252, which doesn't support Unicode characters like the ❌ emoji used in result messages. This caused UnicodeEncodeError when: 1. Reading GitHub event JSON files with UTF-8 content (get_pr_title, is_fork_pr, get_pr_number) 2. Writing job summary with emoji characters (add_job_summary) 3. Reading/writing result.txt with potential Unicode content Fixed all 7 open() calls to explicitly use encoding='utf-8'.
When text=True, subprocess.run uses the system default encoding (cp1252 on Windows) to encode stdin input. If commit messages contain Unicode characters outside cp1252 (e.g. ❌), the encoding fails with UnicodeEncodeError. The other two subprocess.run calls already had encoding='utf-8'.
Summary
Make this GitHub Action compatible with Windows runners (
windows-latest). The core logic (main.py) is already cross-platform — the only blockers were in the composite action's shell run block.Changes
action.ymlBefore, all paths and commands were hardcoded for Linux/macOS:
python3python3not availablesource venv/bin/activatevenv/Scripts/activatepython3 ...pythonAfter this PR, platform-specific variables are set early:
All subsequent commands use
$PYTHON_CMDandsource "$VENV_ACTIVATE".Compatibility
ubuntu-latest— identical behavior (just indirect via variables now)macos-latest— identical behaviorwindows-latest— newly supportedmain.py— it already uses cross-platform stdlib APIscommit-checkandPyGithubare both pure-Python wheels (py3-none-any), so no platform-specific wheel issuesTesting
Could you run the action on a Windows runner before merging to confirm? Something like:
Summary by CodeRabbit