Use MonkeyCode's Free Tokens to Build a PR Summarizer in CI That Doesn't Spam
Description and use
Create a single summary comment per PR using GitHub Actions, MonkeyCode, and Python to avoid duplication and timeouts.
Problem
AI review bots often spam pull requests with duplicate or flaky comments, eroding trust and cluttering discussions.
Outcome
The workflow produces one concise, bullet‑point summary per PR, avoids duplicate comments, and respects free server limits with a 60‑second timeout.
Workflow
- Trigger on pull_request opened or synchronize events
- Checkout repository with full history
- Generate diff against base branch
- Call MonkeyCode free model via OpenAI-compatible endpoint with diff payload
- Receive and parse summary
- Upsert a single comment marked with
<!-- ai-pr-summary -->, updating if it already exists
Evidence
The fix is to make the workflow stateful in three places: Cache the model response by diff hash, Comment with a marker, Set a timeout
Replace the placeholder with the real value before running it
- Record date: 2026-09-10T01:00:15.614Z