Skip to content

feat: add automated PR review agent that summarizes changes as a comment#1

Merged
mhreficode merged 2 commits into
mainfrom
copilot/create-pr-review-agent
Jun 16, 2026
Merged

feat: add automated PR review agent that summarizes changes as a comment#1
mhreficode merged 2 commits into
mainfrom
copilot/create-pr-review-agent

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

No automated PR summarization existed — reviewers had to manually parse diffs to understand scope and risk.

What's added

.github/workflows/pr-review-agent.yml — GitHub Actions workflow that fires on every PR open/update and posts an AI-generated summary comment.

Behavior

  • Fetches PR metadata + up to 100 changed files with diff patches via GitHub REST API
  • Sends a structured prompt (title, description, file list, first 15 patches ≤ 2 000 chars each) to GitHub Models (gpt-4o-mini)
  • Posts a comment structured as Summary / Changes / Potential concerns
  • Deletes the previous bot comment before posting — re-pushes always show one up-to-date summary
  • Falls back to a plain file-change list if the Models endpoint is unavailable

Permissions

permissions:
  contents: read
  pull-requests: write

Token note

GITHUB_TOKEN works for GitHub Models on public repos. For private repos, a PAT with models:read scope stored as a repository secret is required — swap it into the env.GITHUB_TOKEN field.

Original prompt

create PR review agent for this repo, so when there is a PR made, summarizes the chnages and add as a comment to PR

The user has attached the following file paths as relevant context:

  • .github/copilot-instructions.md

Created from VS Code.

Adds .github/workflows/pr-review-agent.yml — a GitHub Actions workflow
that fires on every pull_request (opened / synchronize / reopened),
fetches the PR diff via the GitHub API, calls the GitHub Models
(gpt-4o-mini) endpoint for an AI-generated summary, and posts the
result as a PR comment.  A structured fallback comment is posted when
the AI endpoint is unavailable.  Previous bot summary comments are
deleted first so the thread stays clean.
Copilot AI changed the title [WIP] Add PR review agent to summarize changes feat: add automated PR review agent that summarizes changes as a comment Jun 16, 2026
Copilot AI requested a review from mhreficode June 16, 2026 03:37
@mhreficode
mhreficode marked this pull request as ready for review June 16, 2026 03:39
@github-actions

Copy link
Copy Markdown

🤖 PR Review Agent

Summary

This PR — feat: add automated PR review agent that summarizes changes as a comment — modifies 1 file(s).

Changes

  • .github/workflows/pr-review-agent.yml (added): +140 −0

Potential concerns

AI summarization was unavailable; please review manually.


Generated automatically by the PR Review Agent.

@mhreficode
mhreficode merged commit f8bd416 into main Jun 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants