Skip to content

docs: update README and CI guide for v0.6.0 - #55

Merged
brucearctor merged 2 commits into
mainfrom
docs/v0.6.0-readme
Jul 27, 2026
Merged

docs: update README and CI guide for v0.6.0#55
brucearctor merged 2 commits into
mainfrom
docs/v0.6.0-readme

Conversation

@brucearctor

@brucearctor brucearctor commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Updates documentation to reflect all v0.6.0 features.

README.md

  • Opening line now mentions GitHub + OpenAI-compatible endpoints
  • 6 new features listed (GitHub, suggestions, multi-line, description update, cleanup mode, draft notes)
  • Complete GitHub Actions quick start with Workload Identity Federation
  • Config tables: --update-description, --cleanup-mode, GITHUB_TOKEN
  • GitHub API auth section
  • Per-repo config: update_description, cleanup_mode
  • Fixed stale version refs (v0.5.1v0.6.0)

docs/CI-SETUP.md

  • Replaced GitHub Actions workaround (actions/github-script hack) with native integration
  • Added GitHub Code Scanning (SARIF) section
  • Documented GITHUB_TOKEN permissions (pull-requests: write)

Summary by CodeRabbit

  • Documentation
    • Updated GitHub pull request and GitLab merge request integration guidance.
    • Added documentation for inline suggestions, multi-line comments, description updates, review cleanup, and draft notes.
    • Expanded GitHub Actions setup instructions, including native reviews and SARIF security reporting.
    • Documented new configuration options for updating descriptions and cleaning up prior reviews.
    • Updated setup examples and release references to version 0.6.0.

README.md:
- Opening line: add GitHub + OpenAI-compatible support
- Features: 6 new v0.6.0 features (GitHub, suggestions, multi-line,
  description update, cleanup mode, draft notes)
- Quick Start: add GitHub Actions section with full workflow example
- Config tables: add --update-description, --cleanup-mode, GITHUB_TOKEN
- Auth: add GitHub API token reference
- Per-repo config: add update_description, cleanup_mode
- Fix stale version refs (v0.5.1 → v0.6.0)

docs/CI-SETUP.md:
- Replace GitHub Actions workaround with native integration guide
- Add GitHub Code Scanning (SARIF) section
- Document GITHUB_TOKEN permissions
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@brucearctor, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9768be02-cb61-41b6-bc18-6ac46d6fd38d

📥 Commits

Reviewing files that changed from the base of the PR and between 674a3c2 and 922be6b.

📒 Files selected for processing (2)
  • README.md
  • docs/CI-SETUP.md
📝 Walkthrough

Walkthrough

The documentation now presents GitHub pull request review alongside GitLab support, documents new review configuration options, updates GitHub Actions setup for v0.6.0, and adds SARIF workflow guidance with Code Scanning upload permissions.

Changes

GitHub integration documentation

Layer / File(s) Summary
Feature and configuration documentation
README.md
README features, CLI flags, environment variables, repository configuration, token capabilities, pre-commit version, and release instructions are updated for GitHub integration and v0.6.0.
README GitHub Actions setup
README.md
The quick setup includes Workload Identity Federation, GITHUB_TOKEN, and installation of code-reviewer v0.6.0.
CI workflow and SARIF guidance
docs/CI-SETUP.md
GitHub pull request review and SARIF workflows now include updated permissions, security-focused review execution, and explicit SARIF upload steps.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the docs-focused update and the v0.6.0 version bump.
Description check ✅ Passed The description covers the main changes and rationale, but it omits the template's Testing checklist and explicit What/Why/How headings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/v0.6.0-readme

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 152-156: Update the README CLI options table entry for --ci to
describe its platform-neutral CI behavior, replacing the GitLab-specific wording
while leaving the workflow invocation and other option documentation unchanged.
- Around line 127-159: Document the fork pull-request limitation for the GitHub
workflows: in README.md lines 127-159 and docs/CI-SETUP.md lines 127-154 and
163-200, explain that fork-triggered pull_request workflows receive read-only
GITHUB_TOKEN permissions by default, so pull-requests: write and
security-events: write actions fail unless write tokens for forks are explicitly
enabled, and note the associated security risk or recommend a separately secured
trusted workflow.
- Around line 134-138: Add id-token: write to the permissions blocks for all
three GCP Workload Identity Federation workflows using
google-github-actions/auth: README.md lines 134-138, docs/CI-SETUP.md lines
134-145, and docs/CI-SETUP.md lines 170-182. Preserve each block’s existing
contents, including contents, pull-requests, and security-events permissions
where present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 48bb0e31-babe-4c11-8a7d-2e35323a9cd1

📥 Commits

Reviewing files that changed from the base of the PR and between e8680e2 and 674a3c2.

📒 Files selected for processing (2)
  • README.md
  • docs/CI-SETUP.md

Comment thread README.md
Comment on lines +127 to +159
```yaml
name: Code Review
on:
pull_request:
types: [opened, synchronize]

jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.WIF_SA }}

- name: Install code-reviewer
run: go install github.com/OpticDiff/code-reviewer/cmd/code-reviewer@v0.6.0

- name: Review PR
env:
GOOGLE_CLOUD_PROJECT: ${{ secrets.GCP_PROJECT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: code-reviewer --ci
```

The `GITHUB_TOKEN` is provided automatically by GitHub Actions. The tool detects the GitHub environment and posts review comments on the PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Git status/stat:\n'
git diff --stat || true
printf '\nRelevant README/CI-SETUP excerpts:\n'
for f in README.md docs/CI-SETUP.md; do
  if [ -f "$f" ]; then
    echo "---- $f ----"
    wc -l "$f"
    sed -n '110,210p' "$f" | sed -n '1,70p'
  else
    echo "missing $f"
  fi
done

printf '\nSearch for repository/CI setup guidance around forks/settings:\n'
rg -n "fork|Fork|read-only|permission|pull-requests: write|security-events: write|GITHUB_TOKEN" README.md docs/CI-SETUP.md .

Repository: OpticDiff/code-reviewer

Length of output: 8498


🌐 Web query:

GitHub Actions pull_request forks write token permissions fork repository pull_requests read only

💡 Result:

When a GitHub Actions workflow is triggered by a pull request from a forked repository using the pull_request event, GitHub automatically adjusts the permissions of the GITHUB_TOKEN to read-only [1][2]. This restriction is a critical security measure to prevent unauthorized users from escalating privileges or accessing repository secrets [3][4]. Key details regarding this behavior include: 1. Automatic Downgrade: For workflows triggered by a pull request from a fork, any write permissions explicitly configured in the workflow file are downgraded to read-only [2][5]. This applies to pull_request, pull_request_review, and pull_request_review_comment events [2][5]. 2. Secret Access: Workflows triggered by pull_request from a fork do not have access to repository or organization secrets [1][3]. 3. Repository Settings: Maintainers can control these behaviors through the repository's Actions settings: - Send write tokens to workflows from pull requests: If enabled, this allows fork pull requests to use a GITHUB_TOKEN with write permissions [1]. This should be used with extreme caution [6]. - Require approval for fork pull request workflows: This policy can force workflows from non-collaborators to wait for approval from someone with write access before running [1]. 4. The pull_request_target Event: Unlike the standard pull_request event, pull_request_target runs in the context of the base repository and is granted access to secrets and a read/write GITHUB_TOKEN [3][4]. Because this event runs with elevated trust, it is a frequent target for exploitation (often called pwn requests) [7][6]. It is highly recommended never to check out, build, or run untrusted code from a fork when using this trigger [3][8][6]. Recent security updates (as of June 2026) have introduced stricter defaults for actions/checkout to prevent insecure checkouts of fork code in these workflows [7]. For secure automation, it is recommended to separate build and reporting tasks. Use a pull_request workflow (read-only, no secrets) to build and test code, and use a separate, restricted workflow triggered by other means (e.g., workflow_run) or with careful validation in pull_request_target to handle tasks requiring write access or secrets [4][8][6].

Citations:


Document the fork PR token limitation in the GitHub workflows.

pull_request workflows from forks receive read-only GITHUB_TOKEN permissions by default, so the pull-requests: write and SARIF security-events: write workflows will fail unless the repository explicitly allows write tokens for forks—a security-sensitive setting. Address this at:

  • README.md#L127-L159
  • docs/CI-SETUP.md#L127-L154
  • docs/CI-SETUP.md#L163-L200

Consider documenting the fork limitation or moving trusted PR-writing tasks to a separately secured design/workflow instead.

📍 Affects 2 files
  • README.md#L127-L159 (this comment)
  • docs/CI-SETUP.md#L127-L154
  • docs/CI-SETUP.md#L163-L200
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 127 - 159, Document the fork pull-request limitation
for the GitHub workflows: in README.md lines 127-159 and docs/CI-SETUP.md lines
127-154 and 163-200, explain that fork-triggered pull_request workflows receive
read-only GITHUB_TOKEN permissions by default, so pull-requests: write and
security-events: write actions fail unless write tokens for forks are explicitly
enabled, and note the associated security risk or recommend a separately secured
trusted workflow.

Comment thread README.md
Comment thread README.md
- Add id-token: write to all WIF permissions blocks (required for OIDC)
- Update --ci flag description to platform-neutral wording
@brucearctor
brucearctor merged commit 021a8d1 into main Jul 27, 2026
4 checks passed
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