fix: use temp directory for result file#226
Conversation
…rectory Replace hardcoded 'result.txt' with get_result_path() that uses RUNNER_TEMP (GitHub Actions) or tempfile.gettempdir() (local) to avoid conflicting with user project files. - Add get_result_path() helper function - Update run_commit_check() and read_result_file() to use it - Update tests to set RUNNER_TEMP in setUp
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ 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 |
Commit-Check ✔️ |
Summary
Replace the hardcoded
"result.txt"(written toGITHUB_WORKSPACE) with a path underRUNNER_TEMP, the GitHub Actions temp directory that is auto-cleaned after each job.Changes
get_result_path()— usesRUNNER_TEMPenv var (commit-check-result.txtunder it) or falls back totempfile.gettempdir()run_commit_check()andread_result_file()now callget_result_path()instead of hardcoding"result.txt"setUp/tearDownin 5 test classes to set/unsetRUNNER_TEMPso tests write to the expected locationtest_pr_title_check_runs_when_enabledexpected["--message"]but actual is["--message", "--no-banner"])Why
Writing to the current working directory in a GitHub Action can overwrite files in the user's repository.
RUNNER_TEMPis the safe, documented location for temporary files.Closes #N/A