GitHub Issues Event

GitHub issues webhook payload with labels, milestones, assignees, and state tracking.

Report an issue
github

Install

$ npx shadcn@latest add @open-types/github-issues-event

Dependencies

Source

import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubLabel,
  GitHubMilestone,
} from "./github-shared";

export type GitHubIssuesAction =
  | "assigned"
  | "closed"
  | "deleted"
  | "demilestoned"
  | "edited"
  | "labeled"
  | "locked"
  | "milestoned"
  | "opened"
  | "pinned"
  | "reopened"
  | "transferred"
  | "unassigned"
  | "unlabeled"
  | "unlocked"
  | "unpinned";

export interface GitHubIssue {
  id: number;
  node_id: string;
  number: number;
  title: string;
  user: GitHubUser;
  labels: GitHubLabel[];
  state: "open" | "closed";
  locked: boolean;
  assignees: GitHubUser[];
  milestone: GitHubMilestone | null;
  comments: number;
  created_at: string;
  updated_at: string;
  closed_at: string | null;
  body: string | null;
  state_reason?: string | null;
  html_url: string;
  url: string;
}

export interface GitHubIssuesChanges {
  title?: { from: string };
  body?: { from: string };
}

export interface GitHubIssuesEvent {
  action: GitHubIssuesAction;
  issue: GitHubIssue;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
  label?: GitHubLabel;
  assignee?: GitHubUser;
  milestone?: GitHubMilestone;
  changes?: GitHubIssuesChanges;
}
import type {
  GitHubUser,
  GitHubRepository,
  GitHubOrganization,
  GitHubLabel,
  GitHubMilestone,
} from "./github-shared";

export type GitHubIssuesAction =
  | "assigned"
  | "closed"
  | "deleted"
  | "demilestoned"
  | "edited"
  | "labeled"
  | "locked"
  | "milestoned"
  | "opened"
  | "pinned"
  | "reopened"
  | "transferred"
  | "unassigned"
  | "unlabeled"
  | "unlocked"
  | "unpinned";

export interface GitHubIssue {
  id: number;
  node_id: string;
  number: number;
  title: string;
  user: GitHubUser;
  labels: GitHubLabel[];
  state: "open" | "closed";
  locked: boolean;
  assignees: GitHubUser[];
  milestone: GitHubMilestone | null;
  comments: number;
  created_at: string;
  updated_at: string;
  closed_at: string | null;
  body: string | null;
  state_reason?: string | null;
  html_url: string;
  url: string;
}

export interface GitHubIssuesChanges {
  title?: { from: string };
  body?: { from: string };
}

export interface GitHubIssuesEvent {
  action: GitHubIssuesAction;
  issue: GitHubIssue;
  repository: GitHubRepository;
  sender: GitHubUser;
  organization?: GitHubOrganization;
  label?: GitHubLabel;
  assignee?: GitHubUser;
  milestone?: GitHubMilestone;
  changes?: GitHubIssuesChanges;
}