| 1 | # Continue PR Review Actions |
| 2 | |
| 3 | GitHub Actions that provide automated code reviews for pull requests using Continue CLI. |
| 4 | |
| 5 | ## Available Actions |
| 6 | |
| 7 | This repository provides two GitHub Actions for different review styles: |
| 8 | |
| 9 | ### 1. General Review Action |
| 10 | |
| 11 | Provides high-level PR assessment with overall feedback and recommendations. |
| 12 | |
| 13 | - **Path:** `continuedev/continue/actions/general-review@<commit-sha>` |
| 14 | - **Trigger:** `@continue-general-review` |
| 15 | - **Output:** Summary comment with strengths, issues, and recommendations |
| 16 | |
| 17 | ### 2. Detailed Review Action |
| 18 | |
| 19 | Provides line-by-line inline comments on specific code changes. |
| 20 | |
| 21 | - **Path:** `continuedev/continue/actions/detailed-review@<commit-sha>` |
| 22 | - **Trigger:** `@continue-detailed-review` |
| 23 | - **Output:** Inline review comments on specific lines of code |
| 24 | |
| 25 | ## Quick Start |
| 26 | |
| 27 | ### Using Both Actions Together |
| 28 | |
| 29 | ```yaml |
| 30 | name: PR Reviews |
| 31 | on: |
| 32 | pull_request: |
| 33 | types: [opened, ready_for_review] |
| 34 | issue_comment: |
| 35 | types: [created] |
| 36 | |
| 37 | permissions: |
| 38 | contents: read |
| 39 | pull-requests: write |
| 40 | issues: write |
| 41 | |
| 42 | jobs: |
| 43 | general-review: |
| 44 | runs-on: ubuntu-latest |
| 45 | timeout-minutes: 10 |
| 46 | steps: |
| 47 | - uses: continuedev/continue/actions/general-review@<commit-sha> |
| 48 | with: |
| 49 | continue-api-key: ${{ secrets.CONTINUE_API_KEY }} |
| 50 | continue-org: "your-org-name" |
| 51 | continue-config: "your-org-name/review-bot" |
| 52 | |
| 53 | detailed-review: |
| 54 | runs-on: ubuntu-latest |
| 55 | timeout-minutes: 10 |
| 56 | steps: |
| 57 | - uses: continuedev/continue/actions/detailed-review@<commit-sha> |
| 58 | with: |
| 59 | continue-api-key: ${{ secrets.CONTINUE_API_KEY }} |
| 60 | continue-org: "your-org-name" |
| 61 | continue-config: "your-org-name/review-bot" |
| 62 | ``` |
| 63 | |
| 64 | ### General Review Only |
| 65 | |
| 66 | ```yaml |
| 67 | name: PR General Review |
| 68 | on: |
| 69 | pull_request: |
| 70 | types: [opened, ready_for_review] |
| 71 | issue_comment: |
| 72 | types: [created] |
| 73 | |
| 74 | permissions: |
| 75 | contents: read |
| 76 | pull-requests: write |
| 77 | issues: write |
| 78 | |
| 79 | jobs: |
| 80 | review: |
| 81 | runs-on: ubuntu-latest |
| 82 | timeout-minutes: 10 |
| 83 | steps: |
| 84 | - uses: continuedev/continue/actions/general-review@<commit-sha> |
| 85 | with: |
| 86 | continue-api-key: ${{ secrets.CONTINUE_API_KEY }} |
| 87 | continue-org: "your-org-name" |
| 88 | continue-config: "your-org-name/review-bot" |
| 89 | ``` |
| 90 | |
| 91 | ### Detailed Review Only |
| 92 | |
| 93 | ```yaml |
| 94 | name: PR Detailed Review |
| 95 | on: |
| 96 | pull_request: |
| 97 | types: [opened, ready_for_review] |
| 98 | issue_comment: |
| 99 | types: [created] |
| 100 | |
| 101 | permissions: |
| 102 | contents: read |
| 103 | pull-requests: write |
| 104 | issues: write |
| 105 | |
| 106 | jobs: |
| 107 | review: |
| 108 | runs-on: ubuntu-latest |
| 109 | timeout-minutes: 10 |
| 110 | steps: |
| 111 | - uses: continuedev/continue/actions/detailed-review@<commit-sha> |
| 112 | with: |
| 113 | continue-api-key: ${{ secrets.CONTINUE_API_KEY }} |
| 114 | continue-org: "your-org-name" |
| 115 | continue-config: "your-org-name/review-bot" |
| 116 | ``` |
| 117 | |
| 118 | ## Inputs |
| 119 | |
| 120 | Both actions accept the same inputs: |
| 121 | |
| 122 | | Input | Description | Required | |
| 123 | | ------------------ | -------------------------------------- | -------- | |
| 124 | | `continue-api-key` | API key for Continue service | Yes | |
| 125 | | `continue-org` | Organization for Continue config | Yes | |
| 126 | | `continue-config` | Config path (e.g., "myorg/review-bot") | Yes | |
| 127 | |
| 128 | ## Setup Requirements |
| 129 | |
| 130 | ### 1. Continue API Key |
| 131 | |
| 132 | Add your Continue API key as a secret named `CONTINUE_API_KEY` in your repository: |
| 133 | |
| 134 | 1. Go to your repository's Settings |
| 135 | 2. Navigate to Secrets and variables → Actions |
| 136 | 3. Click "New repository secret" |
| 137 | 4. Name: `CONTINUE_API_KEY` |
| 138 | 5. Value: Your Continue API key |
| 139 | |
| 140 | ### 2. Continue Configuration |
| 141 | |
| 142 | Set up your review bot configuration in Continue: |
| 143 | |
| 144 | 1. Create a configuration for your organization |
| 145 | 2. Configure the review bot settings |
| 146 | 3. Note your organization name and config path |
| 147 | |
| 148 | ### 3. Workflow Permissions |
| 149 | |
| 150 | The workflow requires these permissions: |
| 151 | |
| 152 | - `contents: read` - To checkout and read repository code |
| 153 | - `pull-requests: write` - To post review comments on PRs |
| 154 | - `issues: write` - To respond to comment triggers |
| 155 | |
| 156 | ## Triggering Reviews |
| 157 | |
| 158 | Both actions can be triggered in two ways: |
| 159 | |
| 160 | ### Automatic Triggers |
| 161 | |
| 162 | - When a PR is opened by a team member (OWNER, MEMBER, or COLLABORATOR) |
| 163 | - When a PR is marked as "ready for review" by a team member |
| 164 | |
| 165 | ### Manual Triggers |
| 166 | |
| 167 | Team members can trigger reviews by commenting on any pull request: |
| 168 | |
| 169 | - `@continue-general-review` - Triggers a general review |
| 170 | - `@continue-detailed-review` - Triggers a detailed inline review |
| 171 | |
| 172 | ## Review Outputs |
| 173 | |
| 174 | ### General Review Output |
| 175 | |
| 176 | The general review provides a structured comment that includes: |
| 177 | |
| 178 | - **Strengths**: What was done well in the PR |
| 179 | - **Issues Found**: Categorized by severity (Critical, High, Medium, Low) |
| 180 | - **Suggestions**: Improvement recommendations |
| 181 | - **Overall Assessment**: Final recommendation (APPROVE, REQUEST_CHANGES, or COMMENT) |
| 182 | |
| 183 | ### Detailed Review Output |
| 184 | |
| 185 | The detailed review provides: |
| 186 | |
| 187 | - **Inline Comments**: Specific feedback on individual lines of code |
| 188 | - **Position Markers**: Comments appear directly on the changed lines |
| 189 | - **Review Summary**: Overall assessment of the changes |
| 190 | - **Actionable Feedback**: Specific suggestions for each issue found |
| 191 | |
| 192 | ## How It Works |
| 193 | |
| 194 | ### General Review Process |
| 195 | |
| 196 | 1. Checks out repository code |
| 197 | 2. Fetches PR diff using GitHub CLI |
| 198 | 3. Generates a comprehensive review prompt |
| 199 | 4. Runs Continue CLI with specified configuration |
| 200 | 5. Posts review as a PR comment |
| 201 | |
| 202 | ### Detailed Review Process |
| 203 | |
| 204 | 1. Checks out repository code |
| 205 | 2. Fetches PR diff with GitHub API positions |
| 206 | 3. Annotates diff with position markers |
| 207 | 4. Generates inline review prompt |
| 208 | 5. Runs Continue CLI for detailed analysis |
| 209 | 6. Posts inline comments using GitHub's review API |
| 210 | |
| 211 | ## Versioning |
| 212 | |
| 213 | We recommend using a specific commit SHA for stability and predictability: |
| 214 | |
| 215 | - `@<commit-sha>` - Pins to a specific commit for maximum stability (recommended) |
| 216 | - `@main` - Uses the latest code from the main branch (for bleeding edge) |
| 217 | - `@v1` - Uses a version tag when available |
| 218 | |
| 219 | Example: |
| 220 | |
| 221 | ```yaml |
| 222 | uses: continuedev/continue/actions/general-review@64bda6b2b3dac1037e9895dbee4ce1d35565e1fe |
| 223 | ``` |
| 224 | |
| 225 | ## Troubleshooting |
| 226 | |
| 227 | ### Review not triggering |
| 228 | |
| 229 | - Ensure the PR author or commenter has appropriate permissions (OWNER, MEMBER, or COLLABORATOR) |
| 230 | - Check that the workflow file is in the default branch |
| 231 | - Verify the Continue API key is correctly set as a repository secret |
| 232 | |
| 233 | ### No review output generated |
| 234 | |
| 235 | - Check the action logs for any errors |
| 236 | - Verify your Continue configuration is correct |
| 237 | - Ensure your Continue API key is valid |
| 238 | |
| 239 | ### Inline comments not appearing (Detailed Review) |
| 240 | |
| 241 | - Check that the PR has a valid diff |
| 242 | - Verify GitHub API permissions are correct |
| 243 | - Review action logs for position calculation errors |
| 244 | |
| 245 | ## Support |
| 246 | |
| 247 | For issues or questions: |
| 248 | |
| 249 | - [Continue Documentation](https://docs.continue.dev) |
| 250 | - [GitHub Issues](https://github.com/continuedev/continue/issues) |
| 251 | - [Discord Community](https://discord.gg/vapESyrFmJ) |