# GitHub Pull Request Review Event

> GitHub pull_request_review webhook payload with review state, author association, and approval tracking.

- Name: `github-pull-request-review-event`
- Categories: github
- Depends on: `@open-types/github-shared`, `@open-types/github-pull-request-event`
- Detail page: https://open-types.dev/types/github-pull-request-review-event

## Install

```bash
# Types only
npx shadcn add @open-types/github-pull-request-review-event

# Types + Zod v4 validators
npx shadcn add @open-types/github-pull-request-review-event-zod

# Types + real-world examples
npx shadcn add @open-types/github-pull-request-review-event-examples
```

## Types

```typescript
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubAuthorAssociation,
} from "./github-shared";
import type { GitHubPullRequest } from "./github-pull-request-event";

export type GitHubPullRequestReviewAction = "submitted" | "edited" | "dismissed";

export type GitHubPullRequestReviewState =
  | "approved"
  | "changes_requested"
  | "commented"
  | "dismissed";

export interface GitHubPullRequestReview {
  id: number;
  node_id: string;
  user: GitHubUser;
  body: string | null;
  commit_id: string;
  submitted_at: string;
  state: GitHubPullRequestReviewState;
  html_url: string;
  author_association: GitHubAuthorAssociation;
}

export interface GitHubPullRequestReviewChanges {
  body?: { from: string };
}

export interface GitHubPullRequestReviewEvent {
  action: GitHubPullRequestReviewAction;
  review: GitHubPullRequestReview;
  pull_request: GitHubPullRequest;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
  changes?: GitHubPullRequestReviewChanges;
}
```

## Zod validator

```typescript
import * as z from "zod";
import type {
  GitHubPullRequestReviewAction,
  GitHubPullRequestReviewState,
  GitHubPullRequestReview,
  GitHubPullRequestReviewChanges,
  GitHubPullRequestReviewEvent,
} from "../types/github-pull-request-review-event";
import {
  githubUserSchema,
  githubRepositorySchema,
  githubOrganizationSchema,
  githubAuthorAssociationSchema,
} from "./github-shared";
import { githubPullRequestSchema } from "./github-pull-request-event";

export const githubPullRequestReviewActionSchema = z.enum([
  "submitted",
  "edited",
  "dismissed",
]);

export const githubPullRequestReviewStateSchema = z.enum([
  "approved",
  "changes_requested",
  "commented",
  "dismissed",
]);

export const githubPullRequestReviewSchema = z.object({
  id: z.number().int(),
  node_id: z.string(),
  user: githubUserSchema,
  body: z.string().nullable(),
  commit_id: z.string(),
  submitted_at: z.string(),
  state: githubPullRequestReviewStateSchema,
  html_url: z.string(),
  author_association: githubAuthorAssociationSchema,
}) satisfies z.ZodType<GitHubPullRequestReview>;

export const githubPullRequestReviewChangesSchema = z.object({
  body: z.object({ from: z.string() }).optional(),
}) satisfies z.ZodType<GitHubPullRequestReviewChanges>;

export const githubPullRequestReviewEventSchema = z.object({
  action: githubPullRequestReviewActionSchema,
  review: githubPullRequestReviewSchema,
  pull_request: githubPullRequestSchema,
  repository: githubRepositorySchema,
  sender: githubUserSchema,
  organization: githubOrganizationSchema.optional(),
  changes: githubPullRequestReviewChangesSchema.optional(),
}) satisfies z.ZodType<GitHubPullRequestReviewEvent>;

export type {
  GitHubPullRequestReviewAction,
  GitHubPullRequestReviewState,
  GitHubPullRequestReview,
  GitHubPullRequestReviewChanges,
  GitHubPullRequestReviewEvent,
} from "../types/github-pull-request-review-event";
```

## Examples

```typescript
// Source: https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review
// Captured: 2026-05
import type {
  GitHubPullRequestReview,
  GitHubPullRequestReviewChanges,
  GitHubPullRequestReviewEvent,
} from "../types/github-pull-request-review-event";
import {
  githubUserOctocat,
  githubRepositoryHelloWorld,
  githubOrganizationGitHub,
} from "./shared/github.examples";
import { githubPullRequestExamples } from "./github-pull-request-event.examples";

const approvedReview = {
  id: 80,
  node_id: "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=",
  user: githubUserOctocat,
  body: "Looks good to me!",
  commit_id: "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  submitted_at: "2024-09-12T10:45:00Z",
  state: "approved",
  html_url: "https://github.com/octocat/Hello-World/pull/1347#pullrequestreview-80",
  author_association: "MEMBER",
} as const satisfies GitHubPullRequestReview;

export const githubPullRequestReviewExamples = {
  approved: approvedReview,
  changesRequested: {
    ...approvedReview,
    state: "changes_requested",
    body: "Please address the comments below.",
  } satisfies GitHubPullRequestReview,
  commented: {
    ...approvedReview,
    state: "commented",
    body: "Some thoughts inline.",
  } satisfies GitHubPullRequestReview,
  dismissed: {
    ...approvedReview,
    state: "dismissed",
    body: null,
  } satisfies GitHubPullRequestReview,
  emptyBody: { ...approvedReview, body: null } satisfies GitHubPullRequestReview,
} as const;

export const githubPullRequestReviewChangesExamples = {
  body: { body: { from: "Original review body" } } satisfies GitHubPullRequestReviewChanges,
  empty: {} satisfies GitHubPullRequestReviewChanges,
} as const;

const submitted = {
  action: "submitted",
  review: approvedReview,
  pull_request: githubPullRequestExamples.open,
  repository: githubRepositoryHelloWorld,
  sender: githubUserOctocat,
} as const satisfies GitHubPullRequestReviewEvent;

export const githubPullRequestReviewEventExamples = {
  submitted,
  edited: {
    ...submitted,
    action: "edited",
    changes: { body: { from: "Original review" } },
  } satisfies GitHubPullRequestReviewEvent,
  dismissed: {
    ...submitted,
    action: "dismissed",
    review: { ...approvedReview, state: "dismissed", body: null },
  } satisfies GitHubPullRequestReviewEvent,
  inOrg: {
    ...submitted,
    organization: githubOrganizationGitHub,
  } satisfies GitHubPullRequestReviewEvent,
  changesRequested: {
    ...submitted,
    review: {
      ...approvedReview,
      state: "changes_requested",
      body: "Please address the comments.",
    },
  } satisfies GitHubPullRequestReviewEvent,
} as const;
```
