Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions sdk/guides/github-workflows/pr-review.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ description: Use OpenHands Agent to generate meaningful pull request review
This example is available on GitHub: [examples/03_github_workflows/02_pr_review/](https://github.com/OpenHands/software-agent-sdk/tree/main/examples/03_github_workflows/02_pr_review)
</Note>

Automatically review pull requests when labeled with `review-this`, providing feedback on code quality, security, and best practices.
Automatically review pull requests, providing feedback on code quality, security, and best practices. Reviews can be triggered in two ways:
- Requesting `openhands-agent` as a reviewer
- Adding the `review-this` label to the PR

```yaml icon="yaml" expandable agent-sdk/examples/03_github_workflows/01_basic_action/workflow.yml

Expand All @@ -22,16 +24,22 @@ cp examples/03_github_workflows/02_pr_review/workflow.yml .github/workflows/pr-r
# 2. Configure secrets in GitHub Settings → Secrets
# Add: LLM_API_KEY

# 3. Create a "review-this" label in your repository
# 3. (Optional) Create a "review-this" label in your repository
# Go to Issues → Labels → New label
# You can also trigger reviews by requesting "openhands-agent" as a reviewer
```

## Features

- **Automatic Trigger** - Reviews start when `review-this` label is added and is posted on the PR in only 2 or 3 minutes
- **Fast Reviews** - Results posted on the PR in only 2 or 3 minutes
- **Comprehensive Analysis** - Analyzes the changes given the repository context. Covers code quality, security, best practices
- **GitHub Integration** - Posts comments directly to the PR

## Security

- Users with write access (maintainers) can trigger reviews by requesting `openhands-agent` as a reviewer or adding the `review-this` label.
- Maintainers need to read the PR to make sure it's safe to run.

## Related Files

- [Agent Script](https://github.com/OpenHands/software-agent-sdk/blob/main/examples/03_github_workflows/02_pr_review/agent_script.py)
Expand Down