Installations
npm install @octokit/webhooks-examples
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
20.17.0
NPM Version
10.8.3
Score
83.3
Supply Chain
99.7
Quality
84.7
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Languages
TypeScript (97.61%)
JavaScript (2.39%)
Developer
octokit
Download Statistics
Total Downloads
180,367
Last Day
41
Last Week
1,303
Last Month
8,325
Last Year
68,722
GitHub Statistics
232 Stars
915 Commits
41 Forks
14 Watching
4 Branches
35 Contributors
Package Meta Information
Latest Version
7.6.1
Package Id
@octokit/webhooks-examples@7.6.1
Unpacked Size
8.99 MB
Size
382.46 kB
File Count
9
NPM Version
10.8.3
Node Version
20.17.0
Publised On
03 Oct 2024
Total Downloads
Cumulative downloads
Total Downloads
180,367
Last day
-91%
41
Compared to previous day
Last week
-33.9%
1,303
Compared to previous week
Last month
-34.6%
8,325
Compared to previous month
Last year
12.6%
68,722
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Octokit Webhooks
machine-readable, always up-to-date GitHub Webhooks specifications
Download
Download the latest specification at octokit.github.io/webhooks/payload-examples/api.github.com/index.json
Example
Example webhook definition
1{ 2 "name": "issues", 3 "actions": [ 4 "opened", 5 "edited", 6 "deleted", 7 "transferred", 8 "closed", 9 "reopened", 10 "assigned", 11 "unassigned", 12 "labeled", 13 "unlabeled", 14 "milestoned", 15 "demilestoned" 16 ], 17 "examples": [ 18 { 19 "action": "edited", 20 "issue": { 21 "url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", 22 "repository_url": "https://api.github.com/repos/Codertocat/Hello-World", 23 "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/labels{/name}", 24 "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments", 25 "events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/events", 26 "html_url": "https://github.com/Codertocat/Hello-World/issues/2", 27 "id": 327883527, 28 "node_id": "MDU6SXNzdWUzMjc4ODM1Mjc=", 29 "number": 2, 30 "title": "Spelling error in the README file", 31 "user": { 32 "login": "Codertocat", 33 "id": 21031067, 34 "node_id": "MDQ6VXNlcjIxMDMxMDY3", 35 "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 36 "gravatar_id": "", 37 "url": "https://api.github.com/users/Codertocat", 38 "html_url": "https://github.com/Codertocat", 39 "followers_url": "https://api.github.com/users/Codertocat/followers", 40 "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 41 "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 42 "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 43 "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 44 "organizations_url": "https://api.github.com/users/Codertocat/orgs", 45 "repos_url": "https://api.github.com/users/Codertocat/repos", 46 "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 47 "received_events_url": "https://api.github.com/users/Codertocat/received_events", 48 "type": "User", 49 "site_admin": false 50 }, 51 "labels": [ 52 { 53 "id": 949737505, 54 "node_id": "MDU6TGFiZWw5NDk3Mzc1MDU=", 55 "url": "https://api.github.com/repos/Codertocat/Hello-World/labels/bug", 56 "name": "bug", 57 "color": "d73a4a", 58 "default": true 59 } 60 ], 61 "state": "open", 62 "locked": false, 63 "assignee": null, 64 "assignees": [ 65 { 66 "login": "Codertocat", 67 "id": 21031067, 68 "node_id": "MDQ6VXNlcjIxMDMxMDY3", 69 "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 70 "gravatar_id": "", 71 "url": "https://api.github.com/users/Codertocat", 72 "html_url": "https://github.com/Codertocat", 73 "followers_url": "https://api.github.com/users/Codertocat/followers", 74 "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 75 "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 76 "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 77 "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 78 "organizations_url": "https://api.github.com/users/Codertocat/orgs", 79 "repos_url": "https://api.github.com/users/Codertocat/repos", 80 "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 81 "received_events_url": "https://api.github.com/users/Codertocat/received_events", 82 "type": "User", 83 "site_admin": false 84 } 85 ], 86 "milestone": null, 87 "comments": 0, 88 "created_at": "2018-05-30T20:18:32Z", 89 "updated_at": "2018-05-30T20:18:32Z", 90 "closed_at": null, 91 "author_association": "OWNER", 92 "body": "It looks like you accidently spelled 'commit' with two 't's." 93 }, 94 "changes": {}, 95 "repository": { 96 "id": 135493233, 97 "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 98 "name": "Hello-World", 99 "full_name": "Codertocat/Hello-World", 100 "owner": { 101 "login": "Codertocat", 102 "id": 21031067, 103 "node_id": "MDQ6VXNlcjIxMDMxMDY3", 104 "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 105 "gravatar_id": "", 106 "url": "https://api.github.com/users/Codertocat", 107 "html_url": "https://github.com/Codertocat", 108 "followers_url": "https://api.github.com/users/Codertocat/followers", 109 "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 110 "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 111 "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 112 "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 113 "organizations_url": "https://api.github.com/users/Codertocat/orgs", 114 "repos_url": "https://api.github.com/users/Codertocat/repos", 115 "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 116 "received_events_url": "https://api.github.com/users/Codertocat/received_events", 117 "type": "User", 118 "site_admin": false 119 }, 120 "private": false, 121 "html_url": "https://github.com/Codertocat/Hello-World", 122 "description": null, 123 "fork": false, 124 "url": "https://api.github.com/repos/Codertocat/Hello-World", 125 "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 126 "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 127 "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 128 "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 129 "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 130 "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 131 "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 132 "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 133 "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 134 "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 135 "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 136 "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 137 "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 138 "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 139 "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 140 "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 141 "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 142 "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 143 "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 144 "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 145 "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 146 "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 147 "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 148 "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 149 "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 150 "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 151 "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 152 "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 153 "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 154 "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 155 "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 156 "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 157 "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 158 "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 159 "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 160 "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 161 "created_at": "2018-05-30T20:18:04Z", 162 "updated_at": "2018-05-30T20:18:10Z", 163 "pushed_at": "2018-05-30T20:18:30Z", 164 "git_url": "git://github.com/Codertocat/Hello-World.git", 165 "ssh_url": "git@github.com:Codertocat/Hello-World.git", 166 "clone_url": "https://github.com/Codertocat/Hello-World.git", 167 "svn_url": "https://github.com/Codertocat/Hello-World", 168 "homepage": null, 169 "size": 0, 170 "stargazers_count": 0, 171 "watchers_count": 0, 172 "language": null, 173 "has_issues": true, 174 "has_projects": true, 175 "has_downloads": true, 176 "has_wiki": true, 177 "has_pages": true, 178 "forks_count": 0, 179 "mirror_url": null, 180 "archived": false, 181 "open_issues_count": 2, 182 "license": null, 183 "forks": 0, 184 "open_issues": 2, 185 "watchers": 0, 186 "default_branch": "master" 187 }, 188 "sender": { 189 "login": "Codertocat", 190 "id": 21031067, 191 "node_id": "MDQ6VXNlcjIxMDMxMDY3", 192 "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 193 "gravatar_id": "", 194 "url": "https://api.github.com/users/Codertocat", 195 "html_url": "https://github.com/Codertocat", 196 "followers_url": "https://api.github.com/users/Codertocat/followers", 197 "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 198 "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 199 "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 200 "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 201 "organizations_url": "https://api.github.com/users/Codertocat/orgs", 202 "repos_url": "https://api.github.com/users/Codertocat/repos", 203 "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 204 "received_events_url": "https://api.github.com/users/Codertocat/received_events", 205 "type": "User", 206 "site_admin": false 207 } 208 } 209 ] 210}
Download webhook definitions and webhook payloads schema
You can download the latest index.json
file from
unpkg
Usage as Node module
To get an array of all webhook definition objects, require the @octokit/webhooks-examples
package.
1// Use Node.js require: 2const WEBHOOKS = require("@octokit/webhooks-examples/api.github.com/index.json"); 3 4// Or ESM/TypeScript import: 5import WEBHOOKS from "@octokit/webhooks-examples/api.github.com/index.json";
How it works
This package updates itself using a daily cronjob running on GitHub Actions. The
index.json
file is generated by
bin/octokit-webhooks.ts
. Run
npm run octokit-webhooks -- --usage
for instructions. After the update is
complete, run npm run build:webhooks
and npm run build:schema
to update
index.json
and schema.json
files.
The update script is scraping GitHub’s Webhooks Event Types & Payloads documentation page and extracts the meta information using cheerio.
For simpler local testing and tracking of changes all loaded pages are cached in
the cache/
folder.
Adding examples
- All payloads should end with
.payload.json
. - They should be placed in the folder whose name matches the event they're an example of.
- If the payload has an
action
, that should be the start of the filename followed by a.
.
E.g.
check_run/completed.payload.json
check_run/completed.with-organization.payload.json
check_run/rerequested.payload.json
check_run/rerequested.with-organization.payload.json
create/payload.json
create/with-description.payload.json
After making any changes to example payloads, run
npm run build:webhooks -- --cached
to update the exported index.json
file
See also
- octokit/graphql-schema – GitHub’s GraphQL Schema with validation
- octokit/openapi – GitHub REST API route specifications
- octokit/app-permissions – GitHub App permission specifications
LICENSE
No vulnerabilities found.
Reason
all changesets reviewed
Reason
18 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no binaries found in the repo
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:15
Reason
SAST tool is run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Info: all commits (30) are checked with a SAST tool
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy
- Info: Found text in security policy: SECURITY.md:1
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/add_to_octokit_project.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/add_to_octokit_project.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/codeql-analysis.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/immediate-response.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/immediate-response.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prettier.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/prettier.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-notification.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/release-notification.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-notification.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/release-notification.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-notification.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/release-notification.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-notification.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/release-notification.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/update-prettier.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/update-prettier.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/update-prettier.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/update-prettier.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/update.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/update.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/update.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/update.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/update.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/update.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/update.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/update.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/update.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/octokit/webhooks/update.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:34
- Info: 9 out of 21 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 10 third-party GitHubAction dependencies pinned
- Info: 8 out of 9 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Warn: no topLevel permission defined: .github/workflows/add_to_octokit_project.yml:1
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Warn: no topLevel permission defined: .github/workflows/prettier.yml:1
- Warn: no topLevel permission defined: .github/workflows/release-notification.yml:1
- Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:9
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Warn: no topLevel permission defined: .github/workflows/update-prettier.yml:1
- Warn: no topLevel permission defined: .github/workflows/update.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
7.6
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More