Interface GitHubCommit

Represents a GitHub commit.

interface GitHubCommit {
    author: null | GitHubUser;
    commit: {
        author: { date: string; email: string; name: string };
        committer: { date: string; email: string; name: string };
        message: string;
    };
    committer: null
    | GitHubUser;
    files?: GitHubCommitFile[];
    html_url: string;
    parents: { sha: string; url: string }[];
    sha: string;
    stats?: { additions: number; deletions: number; total: number };
}

Properties

author: null | GitHubUser

GitHub user associated with the author (null if no matching account)

commit: {
    author: { date: string; email: string; name: string };
    committer: { date: string; email: string; name: string };
    message: string;
}

Git commit data

Type declaration

  • author: { date: string; email: string; name: string }

    Git author

    • date: string

      ISO 8601 timestamp of authoring

    • email: string

      Author email

    • name: string

      Author name

  • committer: { date: string; email: string; name: string }

    Git committer

    • date: string

      ISO 8601 timestamp of committing

    • email: string

      Committer email

    • name: string

      Committer name

  • message: string

    Commit message

committer: null | GitHubUser

GitHub user associated with the committer (null if no matching account)

Changed files (only present on single commit GET)

html_url: string

URL to the commit on GitHub

parents: { sha: string; url: string }[]

Parent commits

sha: string

Full commit SHA

stats?: { additions: number; deletions: number; total: number }

Commit stats (only present on single commit GET)

Type declaration

  • additions: number

    Number of line additions

  • deletions: number

    Number of line deletions

  • total: number

    Total number of changes