GitHubPushEventModel#

pydantic model safir.github.webhooks.GitHubPushEventModel#

A Pydantic model for the push event webhook when a commit or tag is pushed.

https://docs.github.com/en/webhooks/webhook-events-and-payloads#push

Parameters:

data (Any) –

Show JSON schema
{
   "title": "GitHubPushEventModel",
   "description": "A Pydantic model for the ``push`` event webhook when a commit or\ntag is pushed.\n\nhttps://docs.github.com/en/webhooks/webhook-events-and-payloads#push",
   "type": "object",
   "properties": {
      "repository": {
         "title": "Repository",
         "description": "The repository that was pushed to.",
         "allOf": [
            {
               "$ref": "#/definitions/GitHubRepositoryModel"
            }
         ]
      },
      "installation": {
         "title": "Installation",
         "description": "Information about the GitHub App installation.",
         "allOf": [
            {
               "$ref": "#/definitions/GitHubAppInstallationModel"
            }
         ]
      },
      "ref": {
         "title": "Ref",
         "description": "The full git ref that was pushed. Example: refs/heads/main or refs/tags/v3.14.1.",
         "example": "refs/heads/main",
         "type": "string"
      },
      "before": {
         "title": "Before",
         "description": "The SHA of the most recent commit on ref before the push.",
         "type": "string"
      },
      "after": {
         "title": "After",
         "description": "The SHA of the most recent commit on ref after the push.",
         "type": "string"
      }
   },
   "required": [
      "repository",
      "installation",
      "ref",
      "before",
      "after"
   ],
   "definitions": {
      "GitHubRepoOwnerModel": {
         "title": "GitHubRepoOwnerModel",
         "description": "A Pydantic model for the ``owner`` field found in repository objects.\n\nhttps://docs.github.com/en/rest/repos/repos#get-a-repository",
         "type": "object",
         "properties": {
            "login": {
               "title": "Login name",
               "description": "Login name of the owner (either a user or an organization).",
               "example": "lsst-sqre",
               "type": "string"
            }
         },
         "required": [
            "login"
         ]
      },
      "GitHubRepositoryModel": {
         "title": "GitHubRepositoryModel",
         "description": "A Pydantic model for the ``repository`` field, often found in webhook\npayloads.\n\nhttps://docs.github.com/en/rest/repos/repos#get-a-repository",
         "type": "object",
         "properties": {
            "name": {
               "title": "Repository name",
               "description": "Excludes owner prefix.",
               "example": "times-square-demo",
               "type": "string"
            },
            "full_name": {
               "title": "Full name",
               "description": "Full name, including owner prefix (e.g. ``lsst-sqre/times-square-demo``).)",
               "example": "lsst-sqre/times-square-demo",
               "type": "string"
            },
            "owner": {
               "title": "Owner",
               "description": "The repository's owner.",
               "allOf": [
                  {
                     "$ref": "#/definitions/GitHubRepoOwnerModel"
                  }
               ]
            },
            "default_branch": {
               "title": "Default Branch",
               "description": "The default branch (e.g. main).",
               "example": "main",
               "type": "string"
            },
            "html_url": {
               "title": "Html Url",
               "description": "URL of the repository for browsers.",
               "example": "https://github.com/lsst-sqre/times-square-demo",
               "minLength": 1,
               "maxLength": 2083,
               "format": "uri",
               "type": "string"
            },
            "branches_url": {
               "title": "Branches Url",
               "description": "URI template for the repo's branches endpoint.",
               "example": "https://github.com/lsst-sqre/times-square-demo/branches{/branch}",
               "type": "string"
            },
            "contents_url": {
               "title": "Contents Url",
               "description": "URI template for the contents endpoint.",
               "example": "https://github.com/lsst-sqre/times-square-demo/contents/{+path}",
               "type": "string"
            },
            "trees_url": {
               "title": "Trees Url",
               "description": "URI template for the Git tree API.",
               "example": "https://github.com/lsst-sqre/times-square-demo/git/trees{/sha}",
               "type": "string"
            },
            "blobs_url": {
               "title": "Blobs Url",
               "description": "URI template for the Git blobs API.",
               "example": "https://github.com/lsst-sqre/times-square-demo/git/blobs{/sha}",
               "type": "string"
            }
         },
         "required": [
            "name",
            "full_name",
            "owner",
            "default_branch",
            "html_url",
            "branches_url",
            "contents_url",
            "trees_url",
            "blobs_url"
         ]
      },
      "GitHubAppInstallationModel": {
         "title": "GitHubAppInstallationModel",
         "description": "A Pydantic model for the ``installation`` field found in webhook\npayloads for GitHub Apps.",
         "type": "object",
         "properties": {
            "id": {
               "title": "Id",
               "description": "The installation ID.",
               "type": "string"
            }
         },
         "required": [
            "id"
         ]
      }
   }
}

Fields:
field after: str [Required]#

The SHA of the most recent commit on ref after the push.

field before: str [Required]#

The SHA of the most recent commit on ref before the push.

field installation: GitHubAppInstallationModel [Required]#

Information about the GitHub App installation.

field ref: str [Required]#

The full git ref that was pushed. Example: refs/heads/main or refs/tags/v3.14.1.

field repository: GitHubRepositoryModel [Required]#

The repository that was pushed to.