8000 ci: add a PR-Agent review workflow for same-repo pull requests by inkatze · Pull Request #240 · inkatze/dotfiles · GitHub
[go: up one dir, main page]

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
51 changes: 51 additions & 0 deletions .github/workflows/pr-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: pr-agent

# Same-repo PRs only, and never `pull_request_target`: a fork PR must not
# reach the model secret. Fork PRs are filtered by the job `if:`.
on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

jobs:
# The job name is the check name `/bot-review` gates on; keep it `PR-Agent`.
pr-agent:
name: PR-Agent
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
issues: write
pull-requests: write
env:
# OPENROUTER_API_KEY is the repository secret holding the model credential.
HAS_MODEL_KEY: ${{ secrets.OPENROUTER_API_KEY != '' }}
steps:
- name: Skip while the model secret is absent
if: env.HAS_MODEL_KEY != 'true'
run: echo "::notice title=PR-Agent skipped::Repository secret OPENROUTER_API_KEY is not set; no review was run."

- name: PR-Agent review
if: env.HAS_MODEL_KEY == 'true'
# v0.50.0
uses: the-pr-agent/pr-agent@e673a02076ce09a4726c3d0c3cc85780e59ca52b
env:
OPENROUTER.KEY: ${{ secrets.OPENROUTER_API_KEY }}
# Override the model through repository variables; litellm does not
# know every OpenRouter model, so the window size is set explicitly.
CONFIG.MODEL: ${{ vars.PR_AGENT_MODEL || 'openrouter/moonshotai/kimi-k2.7-code' }}
CONFIG.FALLBACK_MODELS: >-
${{ vars.PR_AGENT_FALLBACK_MODELS
|| '["openrouter/deepseek/deepseek-v4-pro-0813", "openrouter/google/gemini-3.8-flash"]' }}
CONFIG.CUSTOM_MODEL_MAX_TOKENS: "262144"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_action_config.auto_review: "true"
github_action_config.auto_describe: "false"
github_action_config.auto_improve: "false"
Loading
0