-
Notifications
You must be signed in to change notification settings - Fork 0
Description
User Story #81: GitHub Automated Reviewer (GC)
The Goal
Enable GC (your Agent) to autonomously review and approve Pull Requests. This removes the "human-in-the-loop" bottleneck for standard feature development, allowing the agent to move code from feat/* to the :test environment as soon as safety checks pass.
Acceptance Criteria
[ ] GC has a dedicated GitHub Personal Access Token (PAT) with repo permissions stored in GitHub Secrets.
[ ] A GitHub Action workflow is triggered for pull requests into main
[ ] GC only issues an APPROVE review if the linting and build jobs report a success status. and the person that created the pr is able to approve PRS
[ ] The approval includes a comment stating exactly which checks were verified (e.g., "Build passed, Linting passed").
Implementation Details
- The Agent's Logic (GitHub Script)
You can use the actions/github-script to give the agent a "voice." This script runs after your build/lint jobs.
YAML
approve-pr:
needs: lint # Only run if #55 passes
runs-on: ubuntu-latest
steps:
- name: GC Approval
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GC_PAT }}
script: |
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
body: 'GC Agent: Code quality and build checks passed. Proceeding to test deployment.'
})
- Deterministic Gates
Since this is for an agent:
No "Soft" Passes: If the linter has a single warning, the agent must stay silent or "Request Changes."
Log Everything: The agent’s comment should be structured (perhaps even JSON-compatible) so other parts of your pipeline can parse its "thoughts" if needed.
Technical Risks
Looping: Ensure the agent doesn't trigger its own workflows in an infinite loop.
Security: If the agent can auto-approve, a compromised feat/* branch could theoretically reach Prod. We mitigate this later with the Selenium Suite (#82) acting as the final "Physical" gate.