Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

webhooks/github: Add fixtures for deployment status events.

Pritesh Shettyb66447acff07
diff --git a/zerver/webhooks/github/fixtures/deployment_status__error.json b/zerver/webhooks/github/fixtures/deployment_status__error.json
new file mode 100644
index 00000000000..1a39f53423b
--- /dev/null
+++ b/zerver/webhooks/github/fixtures/deployment_status__error.json
@@ -0,0 +1,209 @@
+{
+ "deployment_status": {
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792439815/statuses/10787910773",
+ "id": 10787910773,
+ "node_id": "DES_kwDOQwktts8AAAACgwJ0dQ",
+ "state": "error",
+ "creator": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "description": "",
+ "environment": "production",
+ "target_url": "",
+ "created_at": "2026-02-07T20:00:54Z",
+ "updated_at": "2026-02-07T20:00:54Z",
+ "deployment_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792439815",
+ "repository_url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "environment_url": "",
+ "log_url": "",
+ "performed_via_github_app": null
+ },
+ "deployment": {
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792439815",
+ "id": 3792439815,
+ "node_id": "DE_kwDOQwktts7iDAoH",
+ "task": "deploy",
+ "original_environment": "production",
+ "environment": "production",
+ "description": null,
+ "created_at": "2026-02-07T19:58:47Z",
+ "updated_at": "2026-02-07T20:00:54Z",
+ "statuses_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792439815/statuses",
+ "repository_url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "creator": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "sha": "c308eeb1271af1f4d072cf79e2b4681f2eb88fbb",
+ "ref": "feature",
+ "payload": {
+
+ },
+ "transient_environment": false,
+ "production_environment": true,
+ "performed_via_github_app": null
+ },
+ "check_run": null,
+ "workflow": null,
+ "workflow_run": null,
+ "action": "created",
+ "repository": {
+ "id": 1124674998,
+ "node_id": "R_kgDOQwkttg",
+ "name": "test-repo",
+ "full_name": "Pritesh-30/test-repo",
+ "private": false,
+ "owner": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "html_url": "https://github.com/Pritesh-30/test-repo",
+ "description": null,
+ "fork": false,
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "forks_url": "https://api.github.com/repos/Pritesh-30/test-repo/forks",
+ "keys_url": "https://api.github.com/repos/Pritesh-30/test-repo/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/Pritesh-30/test-repo/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/Pritesh-30/test-repo/teams",
+ "hooks_url": "https://api.github.com/repos/Pritesh-30/test-repo/hooks",
+ "issue_events_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/Pritesh-30/test-repo/events",
+ "assignees_url": "https://api.github.com/repos/Pritesh-30/test-repo/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/Pritesh-30/test-repo/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/Pritesh-30/test-repo/tags",
+ "blobs_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/Pritesh-30/test-repo/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/Pritesh-30/test-repo/languages",
+ "stargazers_url": "https://api.github.com/repos/Pritesh-30/test-repo/stargazers",
+ "contributors_url": "https://api.github.com/repos/Pritesh-30/test-repo/contributors",
+ "subscribers_url": "https://api.github.com/repos/Pritesh-30/test-repo/subscribers",
+ "subscription_url": "https://api.github.com/repos/Pritesh-30/test-repo/subscription",
+ "commits_url": "https://api.github.com/repos/Pritesh-30/test-repo/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/Pritesh-30/test-repo/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/Pritesh-30/test-repo/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/Pritesh-30/test-repo/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/Pritesh-30/test-repo/merges",
+ "archive_url": "https://api.github.com/repos/Pritesh-30/test-repo/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/Pritesh-30/test-repo/downloads",
+ "issues_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/Pritesh-30/test-repo/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/Pritesh-30/test-repo/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/Pritesh-30/test-repo/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/Pritesh-30/test-repo/labels{/name}",
+ "releases_url": "https://api.github.com/repos/Pritesh-30/test-repo/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments",
+ "created_at": "2025-12-29T12:22:21Z",
+ "updated_at": "2026-02-07T19:40:21Z",
+ "pushed_at": "2026-02-07T19:40:18Z",
+ "git_url": "git://github.com/Pritesh-30/test-repo.git",
+ "ssh_url": "[email protected]:Pritesh-30/test-repo.git",
+ "clone_url": "https://github.com/Pritesh-30/test-repo.git",
+ "svn_url": "https://github.com/Pritesh-30/test-repo",
+ "homepage": null,
+ "size": 6,
+ "stargazers_count": 0,
+ "watchers_count": 0,
+ "language": "CSS",
+ "has_issues": true,
+ "has_projects": true,
+ "has_downloads": true,
+ "has_wiki": true,
+ "has_pages": false,
+ "has_discussions": false,
+ "forks_count": 0,
+ "mirror_url": null,
+ "archived": false,
+ "disabled": false,
+ "open_issues_count": 6,
+ "license": null,
+ "allow_forking": true,
+ "is_template": false,
+ "web_commit_signoff_required": false,
+ "topics": [
+
+ ],
+ "visibility": "public",
+ "forks": 0,
+ "open_issues": 6,
+ "watchers": 0,
+ "default_branch": "feature"
+ },
+ "sender": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ }
+}
diff --git a/zerver/webhooks/github/fixtures/deployment_status__failure.json b/zerver/webhooks/github/fixtures/deployment_status__failure.json
new file mode 100644
index 00000000000..30840458c8c
--- /dev/null
+++ b/zerver/webhooks/github/fixtures/deployment_status__failure.json
@@ -0,0 +1,389 @@
+{
+ "deployment_status": {
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792291128/statuses/10787473524",
+ "id": 10787473524,
+ "node_id": "DES_kwDOQwktts8AAAACgvvIdA",
+ "state": "failure",
+ "creator": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "description": "",
+ "environment": "production",
+ "target_url": "https://github.com/Pritesh-30/test-repo/actions/runs/21785382221/job/62855904429",
+ "created_at": "2026-02-07T19:11:28Z",
+ "updated_at": "2026-02-07T19:11:28Z",
+ "deployment_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792291128",
+ "repository_url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "environment_url": "",
+ "log_url": "https://github.com/Pritesh-30/test-repo/actions/runs/21785382221/job/62855904429",
+ "performed_via_github_app": null
+ },
+ "deployment": {
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792291128",
+ "id": 3792291128,
+ "node_id": "DE_kwDOQwktts7iCcU4",
+ "task": "deploy",
+ "original_environment": "production",
+ "environment": "production",
+ "description": null,
+ "created_at": "2026-02-07T19:11:23Z",
+ "updated_at": "2026-02-07T19:11:28Z",
+ "statuses_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792291128/statuses",
+ "repository_url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "creator": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "sha": "b57138e2cd6e7b256bb4ce78ef95ba728765d865",
+ "ref": "feature",
+ "payload": {
+
+ },
+ "transient_environment": false,
+ "production_environment": false,
+ "performed_via_github_app": {
+ "id": 15368,
+ "client_id": "Iv1.05c79e9ad1f6bdfa",
+ "slug": "github-actions",
+ "node_id": "MDM6QXBwMTUzNjg=",
+ "owner": {
+ "login": "github",
+ "id": 9919,
+ "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
+ "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/github",
+ "html_url": "https://github.com/github",
+ "followers_url": "https://api.github.com/users/github/followers",
+ "following_url": "https://api.github.com/users/github/following{/other_user}",
+ "gists_url": "https://api.github.com/users/github/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/github/subscriptions",
+ "organizations_url": "https://api.github.com/users/github/orgs",
+ "repos_url": "https://api.github.com/users/github/repos",
+ "events_url": "https://api.github.com/users/github/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/github/received_events",
+ "type": "Organization",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "name": "GitHub Actions",
+ "description": "Automate your workflow from idea to production",
+ "external_url": "https://help.github.com/en/actions",
+ "html_url": "https://github.com/apps/github-actions",
+ "created_at": "2018-07-30T09:30:17Z",
+ "updated_at": "2025-12-02T18:13:15Z",
+ "permissions": {
+ "actions": "write",
+ "administration": "read",
+ "artifact_metadata": "write",
+ "attestations": "write",
+ "checks": "write",
+ "contents": "write",
+ "copilot_requests": "write",
+ "deployments": "write",
+ "discussions": "write",
+ "issues": "write",
+ "merge_queues": "write",
+ "metadata": "read",
+ "models": "read",
+ "packages": "write",
+ "pages": "write",
+ "pull_requests": "write",
+ "repository_hooks": "write",
+ "repository_projects": "write",
+ "security_events": "write",
+ "statuses": "write",
+ "vulnerability_alerts": "read"
+ },
+ "events": [
+ "branch_protection_rule",
+ "check_run",
+ "check_suite",
+ "create",
+ "delete",
+ "deployment",
+ "deployment_status",
+ "discussion",
+ "discussion_comment",
+ "fork",
+ "gollum",
+ "issues",
+ "issue_comment",
+ "label",
+ "merge_group",
+ "milestone",
+ "page_build",
+ "public",
+ "pull_request",
+ "pull_request_review",
+ "pull_request_review_comment",
+ "push",
+ "registry_package",
+ "release",
+ "repository",
+ "repository_dispatch",
+ "status",
+ "watch",
+ "workflow_dispatch",
+ "workflow_run"
+ ]
+ }
+ },
+ "check_run": {
+ "id": 62855904429,
+ "name": "deploy",
+ "node_id": "CR_kwDOQwktts8AAAAOooD8rQ",
+ "head_sha": "b57138e2cd6e7b256bb4ce78ef95ba728765d865",
+ "external_id": "b4d1d08f-99b4-5ea7-b9d0-4c276f92532e",
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/check-runs/62855904429",
+ "html_url": "https://github.com/Pritesh-30/test-repo/actions/runs/21785382221/job/62855904429",
+ "details_url": "https://github.com/Pritesh-30/test-repo/actions/runs/21785382221/job/62855904429",
+ "status": "completed",
+ "conclusion": "failure",
+ "started_at": "2026-02-07T19:11:25Z",
+ "completed_at": "2026-02-07T19:11:28Z"
+ },
+ "workflow": {
+ "id": 231643274,
+ "node_id": "W_kwDOQwktts4NzpiK",
+ "name": "Deployment Status Test",
+ "path": ".github/workflows/deploy.yml",
+ "state": "active",
+ "created_at": "2026-02-07T19:11:21.000Z",
+ "updated_at": "2026-02-07T19:11:21.000Z",
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/actions/workflows/231643274",
+ "html_url": "https://github.com/Pritesh-30/test-repo/blob/feature/.github/workflows/deploy.yml",
+ "badge_url": "https://github.com/Pritesh-30/test-repo/workflows/Deployment%20Status%20Test/badge.svg"
+ },
+ "workflow_run": {
+ "id": 21785382221,
+ "name": "Deployment Status Test",
+ "node_id": "WFR_kwLOQwktts8AAAAFEoKNTQ",
+ "head_branch": "feature",
+ "head_sha": "b57138e2cd6e7b256bb4ce78ef95ba728765d865",
+ "path": ".github/workflows/deploy.yml",
+ "display_title": "Added failure",
+ "run_number": 1,
+ "event": "push",
+ "status": "completed",
+ "conclusion": "failure",
+ "workflow_id": 231643274,
+ "check_suite_id": 56722057645,
+ "check_suite_node_id": "CS_kwDOQwktts8AAAANNOXprQ",
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/actions/runs/21785382221",
+ "html_url": "https://github.com/Pritesh-30/test-repo/actions/runs/21785382221",
+ "pull_requests": [
+
+ ],
+ "created_at": "2026-02-07T19:11:22Z",
+ "updated_at": "2026-02-07T19:11:28Z",
+ "actor": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "run_attempt": 1,
+ "referenced_workflows": [
+
+ ],
+ "run_started_at": "2026-02-07T19:11:22Z",
+ "triggering_actor": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ }
+ },
+ "action": "created",
+ "repository": {
+ "id": 1124674998,
+ "node_id": "R_kgDOQwkttg",
+ "name": "test-repo",
+ "full_name": "Pritesh-30/test-repo",
+ "private": false,
+ "owner": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "html_url": "https://github.com/Pritesh-30/test-repo",
+ "description": null,
+ "fork": false,
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "forks_url": "https://api.github.com/repos/Pritesh-30/test-repo/forks",
+ "keys_url": "https://api.github.com/repos/Pritesh-30/test-repo/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/Pritesh-30/test-repo/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/Pritesh-30/test-repo/teams",
+ "hooks_url": "https://api.github.com/repos/Pritesh-30/test-repo/hooks",
+ "issue_events_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/Pritesh-30/test-repo/events",
+ "assignees_url": "https://api.github.com/repos/Pritesh-30/test-repo/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/Pritesh-30/test-repo/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/Pritesh-30/test-repo/tags",
+ "blobs_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/Pritesh-30/test-repo/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/Pritesh-30/test-repo/languages",
+ "stargazers_url": "https://api.github.com/repos/Pritesh-30/test-repo/stargazers",
+ "contributors_url": "https://api.github.com/repos/Pritesh-30/test-repo/contributors",
+ "subscribers_url": "https://api.github.com/repos/Pritesh-30/test-repo/subscribers",
+ "subscription_url": "https://api.github.com/repos/Pritesh-30/test-repo/subscription",
+ "commits_url": "https://api.github.com/repos/Pritesh-30/test-repo/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/Pritesh-30/test-repo/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/Pritesh-30/test-repo/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/Pritesh-30/test-repo/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/Pritesh-30/test-repo/merges",
+ "archive_url": "https://api.github.com/repos/Pritesh-30/test-repo/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/Pritesh-30/test-repo/downloads",
+ "issues_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/Pritesh-30/test-repo/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/Pritesh-30/test-repo/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/Pritesh-30/test-repo/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/Pritesh-30/test-repo/labels{/name}",
+ "releases_url": "https://api.github.com/repos/Pritesh-30/test-repo/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments",
+ "created_at": "2025-12-29T12:22:21Z",
+ "updated_at": "2026-02-07T19:11:23Z",
+ "pushed_at": "2026-02-07T19:11:20Z",
+ "git_url": "git://github.com/Pritesh-30/test-repo.git",
+ "ssh_url": "[email protected]:Pritesh-30/test-repo.git",
+ "clone_url": "https://github.com/Pritesh-30/test-repo.git",
+ "svn_url": "https://github.com/Pritesh-30/test-repo",
+ "homepage": null,
+ "size": 6,
+ "stargazers_count": 0,
+ "watchers_count": 0,
+ "language": "CSS",
+ "has_issues": true,
+ "has_projects": true,
+ "has_downloads": true,
+ "has_wiki": true,
+ "has_pages": false,
+ "has_discussions": false,
+ "forks_count": 0,
+ "mirror_url": null,
+ "archived": false,
+ "disabled": false,
+ "open_issues_count": 6,
+ "license": null,
+ "allow_forking": true,
+ "is_template": false,
+ "web_commit_signoff_required": false,
+ "topics": [
+
+ ],
+ "visibility": "public",
+ "forks": 0,
+ "open_issues": 6,
+ "watchers": 0,
+ "default_branch": "feature"
+ },
+ "sender": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ }
+}
diff --git a/zerver/webhooks/github/fixtures/deployment_status__pending.json b/zerver/webhooks/github/fixtures/deployment_status__pending.json
new file mode 100644
index 00000000000..e893b8b2c7b
--- /dev/null
+++ b/zerver/webhooks/github/fixtures/deployment_status__pending.json
@@ -0,0 +1,205 @@
+{
+ "deployment_status": {
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792406560/statuses/10787811949",
+ "id": 10787811949,
+ "node_id": "DES_kwDOQwktts8AAAACgwDybQ",
+ "state": "pending",
+ "creator": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "description": "",
+ "environment": "production",
+ "target_url": "",
+ "created_at": "2026-02-07T19:49:34Z",
+ "updated_at": "2026-02-07T19:49:34Z",
+ "deployment_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792406560",
+ "repository_url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "environment_url": "",
+ "log_url": "",
+ "performed_via_github_app": null
+ },
+ "deployment": {
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792406560",
+ "id": 3792406560,
+ "node_id": "DE_kwDOQwktts7iC4gg",
+ "task": "deploy",
+ "original_environment": "production",
+ "environment": "production",
+ "description": null,
+ "created_at": "2026-02-07T19:48:06Z",
+ "updated_at": "2026-02-07T19:49:34Z",
+ "statuses_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments/3792406560/statuses",
+ "repository_url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "creator": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "sha": "c308eeb1271af1f4d072cf79e2b4681f2eb88fbb",
+ "ref": "feature",
+ "payload": {},
+ "transient_environment": false,
+ "production_environment": true,
+ "performed_via_github_app": null
+ },
+ "check_run": null,
+ "workflow": null,
+ "workflow_run": null,
+ "action": "created",
+ "repository": {
+ "id": 1124674998,
+ "node_id": "R_kgDOQwkttg",
+ "name": "test-repo",
+ "full_name": "Pritesh-30/test-repo",
+ "private": false,
+ "owner": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ },
+ "html_url": "https://github.com/Pritesh-30/test-repo",
+ "description": null,
+ "fork": false,
+ "url": "https://api.github.com/repos/Pritesh-30/test-repo",
+ "forks_url": "https://api.github.com/repos/Pritesh-30/test-repo/forks",
+ "keys_url": "https://api.github.com/repos/Pritesh-30/test-repo/keys{/key_id}",
+ "collaborators_url": "https://api.github.com/repos/Pritesh-30/test-repo/collaborators{/collaborator}",
+ "teams_url": "https://api.github.com/repos/Pritesh-30/test-repo/teams",
+ "hooks_url": "https://api.github.com/repos/Pritesh-30/test-repo/hooks",
+ "issue_events_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues/events{/number}",
+ "events_url": "https://api.github.com/repos/Pritesh-30/test-repo/events",
+ "assignees_url": "https://api.github.com/repos/Pritesh-30/test-repo/assignees{/user}",
+ "branches_url": "https://api.github.com/repos/Pritesh-30/test-repo/branches{/branch}",
+ "tags_url": "https://api.github.com/repos/Pritesh-30/test-repo/tags",
+ "blobs_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/blobs{/sha}",
+ "git_tags_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/tags{/sha}",
+ "git_refs_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/refs{/sha}",
+ "trees_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/trees{/sha}",
+ "statuses_url": "https://api.github.com/repos/Pritesh-30/test-repo/statuses/{sha}",
+ "languages_url": "https://api.github.com/repos/Pritesh-30/test-repo/languages",
+ "stargazers_url": "https://api.github.com/repos/Pritesh-30/test-repo/stargazers",
+ "contributors_url": "https://api.github.com/repos/Pritesh-30/test-repo/contributors",
+ "subscribers_url": "https://api.github.com/repos/Pritesh-30/test-repo/subscribers",
+ "subscription_url": "https://api.github.com/repos/Pritesh-30/test-repo/subscription",
+ "commits_url": "https://api.github.com/repos/Pritesh-30/test-repo/commits{/sha}",
+ "git_commits_url": "https://api.github.com/repos/Pritesh-30/test-repo/git/commits{/sha}",
+ "comments_url": "https://api.github.com/repos/Pritesh-30/test-repo/comments{/number}",
+ "issue_comment_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues/comments{/number}",
+ "contents_url": "https://api.github.com/repos/Pritesh-30/test-repo/contents/{+path}",
+ "compare_url": "https://api.github.com/repos/Pritesh-30/test-repo/compare/{base}...{head}",
+ "merges_url": "https://api.github.com/repos/Pritesh-30/test-repo/merges",
+ "archive_url": "https://api.github.com/repos/Pritesh-30/test-repo/{archive_format}{/ref}",
+ "downloads_url": "https://api.github.com/repos/Pritesh-30/test-repo/downloads",
+ "issues_url": "https://api.github.com/repos/Pritesh-30/test-repo/issues{/number}",
+ "pulls_url": "https://api.github.com/repos/Pritesh-30/test-repo/pulls{/number}",
+ "milestones_url": "https://api.github.com/repos/Pritesh-30/test-repo/milestones{/number}",
+ "notifications_url": "https://api.github.com/repos/Pritesh-30/test-repo/notifications{?since,all,participating}",
+ "labels_url": "https://api.github.com/repos/Pritesh-30/test-repo/labels{/name}",
+ "releases_url": "https://api.github.com/repos/Pritesh-30/test-repo/releases{/id}",
+ "deployments_url": "https://api.github.com/repos/Pritesh-30/test-repo/deployments",
+ "created_at": "2025-12-29T12:22:21Z",
+ "updated_at": "2026-02-07T19:40:21Z",
+ "pushed_at": "2026-02-07T19:40:18Z",
+ "git_url": "git://github.com/Pritesh-30/test-repo.git",
+ "ssh_url": "[email protected]:Pritesh-30/test-repo.git",
+ "clone_url": "https://github.com/Pritesh-30/test-repo.git",
+ "svn_url": "https://github.com/Pritesh-30/test-repo",
+ "homepage": null,
+ "size": 6,
+ "stargazers_count": 0,
+ "watchers_count": 0,
+ "language": "CSS",
+ "has_issues": true,
+ "has_projects": true,
+ "has_downloads": true,
+ "has_wiki": true,
+ "has_pages": false,
+ "has_discussions": false,
+ "forks_count": 0,
+ "mirror_url": null,
+ "archived": false,
+ "disabled": false,
+ "open_issues_count": 6,
+ "license": null,
+ "allow_forking": true,
+ "is_template": false,
+ "web_commit_signoff_required": false,
+ "topics": [],
+ "visibility": "public",
+ "forks": 0,
+ "open_issues": 6,
+ "watchers": 0,
+ "default_branch": "feature"
+ },
+ "sender": {
+ "login": "Pritesh-30",
+ "id": 190011583,
+ "node_id": "U_kgDOC1NYvw",
+ "avatar_url": "https://avatars.githubusercontent.com/u/190011583?v=4",
+ "gravatar_id": "",
+ "url": "https://api.github.com/users/Pritesh-30",
+ "html_url": "https://github.com/Pritesh-30",
+ "followers_url": "https://api.github.com/users/Pritesh-30/followers",
+ "following_url": "https://api.github.com/users/Pritesh-30/following{/other_user}",
+ "gists_url": "https://api.github.com/users/Pritesh-30/gists{/gist_id}",
+ "starred_url": "https://api.github.com/users/Pritesh-30/starred{/owner}{/repo}",
+ "subscriptions_url": "https://api.github.com/users/Pritesh-30/subscriptions",
+ "organizations_url": "https://api.github.com/users/Pritesh-30/orgs",
+ "repos_url": "https://api.github.com/users/Pritesh-30/repos",
+ "events_url": "https://api.github.com/users/Pritesh-30/events{/privacy}",
+ "received_events_url": "https://api.github.com/users/Pritesh-30/received_events",
+ "type": "User",
+ "user_view_type": "public",
+ "site_admin": false
+ }
+}
diff --git a/zerver/webhooks/github/fixtures/deployment_status.json b/zerver/webhooks/github/fixtures/deployment_status__success.json
similarity index 100%
rename from zerver/webhooks/github/fixtures/deployment_status.json
rename to zerver/webhooks/github/fixtures/deployment_status__success.json
diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.py
index 720a7ea2f56..6dd8c013481 100644
--- a/zerver/webhooks/github/tests.py
+++ b/zerver/webhooks/github/tests.py
@@ -144,9 +144,24 @@ class GitHubWebhookTest(WebhookTestCase):
expected_message = "baxterthehacker created new deployment."
self.check_webhook("deployment", TOPIC_DEPLOYMENT, expected_message)
- def test_deployment_status_msg(self) -> None:
+ def test_deployment_status_success_msg(self) -> None:
expected_message = "Deployment changed status to success."
- self.check_webhook("deployment_status", TOPIC_DEPLOYMENT, expected_message)
+ self.check_webhook("deployment_status__success", TOPIC_DEPLOYMENT, expected_message)
+
+ def test_deployment_status_pending_msg(self) -> None:
+ expected_topic_name = "test-repo / Deployment on production"
+ expected_message = "Deployment changed status to pending."
+ self.check_webhook("deployment_status__pending", expected_topic_name, expected_message)
+
+ def test_deployment_status_error_msg(self) -> None:
+ expected_topic_name = "test-repo / Deployment on production"
+ expected_message = "Deployment changed status to error."
+ self.check_webhook("deployment_status__error", expected_topic_name, expected_message)
+
+ def test_deployment_status_failure_msg(self) -> None:
+ expected_topic_name = "test-repo / Deployment on production"
+ expected_message = "Deployment changed status to failure."
+ self.check_webhook("deployment_status__failure", expected_topic_name, expected_message)
def test_fork_msg(self) -> None:
expected_message = "baxterandthehackers forked [public-repo](https://github.com/baxterandthehackers/public-repo)."