You provide credentials, the validation command, and the GitHub merge rules. PR Agent only pushes after it returns PASS and the validation command succeeds.
In Settings → Secrets and variables → Actions, add:
OPENROUTER_API_KEY: an OpenRouter key for the selected model.PR_AGENT_TOKEN: a repository-scoped fine-grained PAT or GitHub App token with Contents: write and Pull requests: write permissions.Use a PAT or GitHub App token because GitHub’s built-in GITHUB_TOKEN does not normally trigger other CI workflows after pushing a repair. GitHub explains this behavior.
Create .github/workflows/pr-agent.yml in your repository. Replace npm test with the real project test command.
name: PR Agent
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
pull-requests: write
jobs:
agent:
uses: zc6600/agentic-swe/.github/workflows/pr-agent.yml@main
with:
validation-command: npm test
secrets:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
PR_AGENT_TOKEN: ${{ secrets.PR_AGENT_TOKEN }}For production, pin the reusable workflow to a reviewed release tag or commit SHA instead of @main.
Turn on Allow auto-merge in repository settings and configure the branch-protection checks required before merging. PR Agent does not bypass these rules.