GitHub Pull Request Review Event

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

Report an issue
github

Install

$ npx shadcn@latest add @open-types/github-pull-request-review-event

Dependencies

Source

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;
}
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;
}