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

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.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.