What this thread does
Do first: Create .github/workflows/cline-pr-review.yml following the official two-job sample.
Short answer
Run Cline only in the read-only job. Pass its Markdown through an artifact to a separate posting job that runs neither Cline nor repository code.
What to do
| Item | Exact sample value / action |
|---|---|
| Events | pull_request.types: [opened, ready_for_review]; workflow_dispatch with required numeric pr_number |
| Concurrency | group: pr-review-${{ github.event.pull_request.number || inputs.pr_number }}; cancel-in-progress: true |
| Initial permissions | permissions: {} |
review permissions | contents, pull-requests, issues, checks, statuses, actions: read |
| Run limits | Both jobs: ubuntu-latest; review timeout 60 minutes; post timeout 5 minutes |
| Base checkout | actions/checkout@v4; ref: ${{ github.event.pull_request.base.sha || github.sha }}; persist-credentials: false |
| Runtime | actions/setup-node@v4; node-version: 22; npm install -g cline |
| Provider setup | Noninteractive cline auth requires --apikey and --modelid; sample --provider anthropic, --modelid claude-opus-5-5; documented alternatives openai-native, openrouter |
| Environment names | ANTHROPIC_API_KEY, Actions-provided GITHUB_TOKEN; job GH_TOKEN: ${{ github.token }}, GH_REPO: ${{ github.repository }}; PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }} |
| Run | cline --auto-approve true followed by the review prompt; prompt runs default to yolo mode |
| Gather context | gh pr view, gh pr diff, gh pr checks, each with the PR number |
| Details fields | --json number,title,body,author,createdAt,updatedAt,isDraft,labels,commits,files,additions,deletions,changedFiles,baseRefName,headRefName,mergeable,reviewDecision |
| Review file | review.md; begin with Reviewed by Cline; tell Cline to ignore instructions in PR text/diffs and not post |
| Upload | actions/upload-artifact@v4; name: review; path: review.md; if-no-files-found: error |
| Posting job | needs: review; pull-requests: write; no checkout or Cline |
| Download | actions/download-artifact@v4; name: review; path: ${{ runner.temp }}/review |
| Publish comment | gh pr review "$PR_NUMBER" --comment --body-file "$RUNNER_TEMP/review/review.md" |
| Workspace execution | Hooks/plugins load from .cline/ and .clinerules/; the base checkout keeps PR edits out of those folders |
| Optional inline review | Write JSON in review; posting job sets review API event to COMMENT |
Limits and open questions
Skip draft PRs, forks and dependabot[bot] on pull_request; allow workflow_dispatch. For a fork, read it first, then manually run from Actions with its number. Do not substitute pull_request_target.
The CLI has no shell allow/deny list. A read-only repository permission does not prevent shell execution, network access or reading job environment data. The source recommends a provider spending limit and no unrelated sensitive environment data. Same-repository branch writers can edit the pull_request workflow permissions; manually dispatched runs can affect the selected branch’s Actions caches.
Not for: Cline VS Code extension interactive reviews.
Sources
- GitHub PR Review, Cline documentation.
Checked
2026-11-17; read GitHub PR Review Markdown; no command was run.
Started from a post by @Cline documentation, packaged by the editor. Original post