From cbc19ab4601d0dfddac0dbbdb68e97390d605a45 Mon Sep 17 00:00:00 2001 From: Simon Rosenberg Date: Thu, 6 Nov 2025 09:34:33 +0100 Subject: [PATCH 1/2] update pr-review doc --- sdk/guides/github-workflows/pr-review.mdx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sdk/guides/github-workflows/pr-review.mdx b/sdk/guides/github-workflows/pr-review.mdx index ffa154c4..571fe8b5 100644 --- a/sdk/guides/github-workflows/pr-review.mdx +++ b/sdk/guides/github-workflows/pr-review.mdx @@ -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) -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 @@ -22,16 +24,21 @@ 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 + +- **Secure by Design** - Only users with write access (maintainers) can trigger reviews by requesting `openhands-agent` as a reviewer or adding the `review-this` label. + ## Related Files - [Agent Script](https://github.com/OpenHands/software-agent-sdk/blob/main/examples/03_github_workflows/02_pr_review/agent_script.py) From 486e7a51f164fc112d69f25db39f853f763c4032 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Thu, 6 Nov 2025 23:35:06 +0800 Subject: [PATCH 2/2] Update sdk/guides/github-workflows/pr-review.mdx Co-authored-by: Engel Nyst --- sdk/guides/github-workflows/pr-review.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/guides/github-workflows/pr-review.mdx b/sdk/guides/github-workflows/pr-review.mdx index 571fe8b5..a91c1672 100644 --- a/sdk/guides/github-workflows/pr-review.mdx +++ b/sdk/guides/github-workflows/pr-review.mdx @@ -37,7 +37,8 @@ cp examples/03_github_workflows/02_pr_review/workflow.yml .github/workflows/pr-r ## Security -- **Secure by Design** - Only users with write access (maintainers) can trigger reviews by requesting `openhands-agent` as a reviewer or adding the `review-this` label. +- 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