Enum octocrab::models::webhook_events::WebhookEventType
source · #[non_exhaustive]pub enum WebhookEventType {
Show 68 variants
BranchProtectionRule,
CheckRun,
CheckSuite,
CodeScanningAlert,
CommitComment,
Create,
Delete,
DependabotAlert,
DeployKey,
Deployment,
DeploymentProtectionRule,
DeploymentStatus,
Discussion,
DiscussionComment,
Fork,
GithubAppAuthorization,
Gollum,
Installation,
InstallationRepositories,
InstallationTarget,
IssueComment,
Issues,
Label,
MarketplacePurchase,
Member,
Membership,
MergeGroup,
Meta,
Milestone,
OrgBlock,
Organization,
Package,
PageBuild,
PersonalAccessTokenRequest,
Ping,
ProjectCard,
Project,
ProjectColumn,
ProjectsV2,
ProjectsV2Item,
Public,
PullRequest,
PullRequestReview,
PullRequestReviewComment,
PullRequestReviewThread,
Push,
RegistryPackage,
Release,
RepositoryAdvisory,
Repository,
RepositoryDispatch,
RepositoryImport,
RepositoryVulnerabilityAlert,
Schedule,
SecretScanningAlert,
SecretScanningAlertLocation,
SecurityAdvisory,
SecurityAndAnalysis,
Sponsorship,
Star,
Status,
TeamAdd,
Team,
Watch,
WorkflowDispatch,
WorkflowJob,
WorkflowRun,
Unknown(String),
}
Expand description
Kind of webhook event.
For all content in quotes, like see "...."
in the documentation strings, you can search for
this exact sentence in the search bar of GitHub docs to go
for the specific documentation page. For example,
this to look for “About
code scanning alerts”.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BranchProtectionRule
This event occurs when there is activity relating to branch protection rules. For more information, see “About protected branches.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Administration” repository permission.
CheckRun
This event occurs when there is activity relating to a check run. For information about check runs, see “Getting started with the Checks API.”
For activity relating to check suites, see the CheckSuite
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Checks” repository permission. To receive the rerequested and requested_action event types, the app must have at least write-level access for the “Checks” permission. GitHub Apps with write-level access for the “Checks” permission are automatically subscribed to this webhook event.
Repository and organization webhooks only receive payloads for the created and completed event types in repositories.
Note: The API only looks for pushes in the repository where the check run was created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch in the payload.
CheckSuite
This event occurs when there is activity relating to a check suite. For information about check suites, see “Getting started with the Checks API.”
For activity relating to check runs, see the CheckRun
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Checks” permission. To receive the requested and rerequested event types, the app must have at lease write-level access for the “Checks” permission. GitHub Apps with write-level access for the “Checks” permission are automatically subscribed to this webhook event.
Repository and organization webhooks only receive payloads for the completed event types in repositories.
Note: The API only looks for pushes in the repository where the check suite was created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.
CodeScanningAlert
This event occurs when there is activity relating to code scanning alerts in a repository. For more information, see “About code scanning” and “About code scanning alerts.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Code scanning alerts” repository permission.
CommitComment
This event occurs when there is activity relating to commit comments. For more information about commit comments, see “Commenting on a pull request.”
For activity relating to comments on pull request reviews, see the
PullRequestReviewComment
event. For activity
relating to issue comments, see the IssueComment
event.
For activity relating to discussion comments, see the
DiscussionComment
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
Create
This event occurs when a Git branch or tag is created.
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
Note: This event will not occur when more than three tags are created at once.
Delete
This event occurs when a Git branch or tag is deleted.
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
Note: This event will not occur when more than three tags are deleted at once.
DependabotAlert
This event occurs when there is activity relating to Dependabot alerts.
For more information about Dependabot alerts, see “About Dependabot alerts.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Dependabot alerts” repository permission.
Note: Webhook events for Dependabot alerts are currently in beta and subject to change.
DeployKey
This event occurs when there is activity relating to deploy keys. For more information, see “Managing deploy keys.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Deployments” repository permission.
Deployment
This event occurs when there is activity relating to deployments. For more information, see “About deployments.”
For activity relating to deployment status, see the
DeploymentStatus
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Deployments” repository permission.
DeploymentProtectionRule
This event occurs when there is activity relating to deployment protection rules. For more information, see “Using environments for deployment.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Deployments” repository permission.
DeploymentStatus
This event occurs when there is activity relating to deployment statuses. For more information, see “About deployments.”
For activity relating to deployment creation, see the
Deployment
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Deployments” repository permission.
Discussion
This event occurs when there is activity relating to a discussion. For more information about discussions, see “GitHub Discussions.”
For activity relating to a comment on a discussion, see the
DiscussionComment
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Discussions” repository permission.
Note: Webhook events for GitHub Discussions are currently in beta and subject to change.
DiscussionComment
This event occurs when there is activity relating to a comment on a discussion. For more information about discussions, see “GitHub Discussions.”
For activity relating to a discussion as opposed to comments on a discussion, use the
Discussion
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Discussions” repository permission.
Note: Webhook events for GitHub Discussions are currently in beta and subject to change.
Fork
This event occurs when someone forks a repository. For more information, see “Fork a repo.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
GithubAppAuthorization
This event occurs when a user revokes their authorization of a GitHub App. For more information, see “About apps.”
A GitHub App receives this webhook by default and cannot unsubscribe from this event.
Anyone can revoke their authorization of a GitHub App from their GitHub account settings page. Revoking the authorization of a GitHub App does not uninstall the GitHub App. You should program your GitHub App so that when it receives this webhook, it stops calling the API on behalf of the person who revoked the token. If your GitHub App continues to use a revoked access token, it will receive the 401 Bad Credentials error. For details about requests with a user access token, which require GitHub App authorization, see “Authenticating with a GitHub App on behalf of a user.”
Gollum
This event occurs when someone creates or updates a wiki page. For more information, see “About wikis.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
Installation
This event occurs when there is activity relating to a GitHub App installation. All GitHub Apps receive this event by default. You cannot manually subscribe to this event.
For more information about GitHub Apps, see “About apps.”
InstallationRepositories
This event occurs when there is activity relating to which repositories a GitHub App installation can access. All GitHub Apps receive this event by default. You cannot manually subscribe to this event.
For more information about GitHub Apps, see “About apps.”
InstallationTarget
This event occurs when there is activity relating to the user or organization account that a GitHub App is installed on. For more information, see “About apps.”
IssueComment
This event occurs when there is activity relating to a comment on an issue or pull request. For more information about issues and pull requests, see “About issues” and “About pull requests.”
For activity relating to an issue as opposed to comments on an issue, see the
Issues
event. For activity related to pull request reviews or
pull request review comments, use the
PullRequestReview
or
PullRequestReviewComment
events. For more
information about the different types of pull request comments, see “Working with comments.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Issues” repository permission.
Issues
This event occurs when there is activity relating to an issue. For more information about issues, see “About issues.”
For activity relating to a comment on an issue, see the
IssueComment
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Issues” repository permission.
Label
This event occurs when there is activity relating to labels. For more information, see “Managing labels.”
If you want to receive an event when a label is added to or removed from an issue, pull
request, or discussion, use the labeled or unlabeled action type for the
Issues
PullRequest
or
Discussion
events instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Metadata” repository permission.
MarketplacePurchase
This event occurs when there is activity relating to a GitHub Marketplace purchase. For more information, see “GitHub Marketplace.”
Member
This event occurs when there is activity relating to collaborators in a repository. For more information, see “Adding outside collaborators to repositories in your organization.” For more information about the API to manage repository collaborators, see the GraphQL API documentation or “Collaborators” in the REST API documentation.
To subscribe to this event, a GitHub App must have at least read-level access for the “Members” organization permission.
Membership
This event occurs when there is activity relating to team membership. For more information, see “About teams.” For more information about the APIs to manage team memberships, see the GraphQL API documentation or “Team members” in the REST API documentation.
To subscribe to this event, a GitHub App must have at least read-level access for the “Members” organization permission.
MergeGroup
This event occurs when there is activity relating to a merge group in a merge queue. For more information, see “Managing a merge queue.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Merge queues” repository permission.
Meta
This event occurs when there is activity relating to a webhook itself.
To subscribe to this event, a GitHub App must have at least read-level access for the “Meta” app permission.
Milestone
This event occurs when there is activity relating to milestones. For more information, see “About milestones.”
If you want to receive an event when an issue or pull request is added to or removed from a
milestone, use the milestoned or demilestoned action type for the
Issues
or PullRequest
events
instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Issues” or “Pull requests” repository permissions.
OrgBlock
This event occurs when organization owners or moderators block or unblock a non-member from collaborating on the organization’s repositories. For more information, see “Blocking a user from your organization.”
If you want to receive an event when members are added or removed from an organization, use
the Organization
event instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Administration” organization permission.
Organization
This event occurs when there is activity relating to an organization and its members. For more information, see “About organizations.”
If you want to receive an event when a non-member is blocked or unblocked from an
organization, see the OrgBlock
event instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Members” organization permission.
Package
This event occurs when there is activity relating to GitHub Packages. For more information, see “Introduction to GitHub Packages.”
To install this event on a GitHub App, the app must have at least read-level access for the “Packages” repository permission.
PageBuild
This event occurs when there is an attempted build of a GitHub Pages site. This event occurs regardless of whether the build is successful. For more information, see “Configuring a publishing source for your GitHub Pages site.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Pages” repository permission.
PersonalAccessTokenRequest
This event occurs when there is activity relating to a request for a fine-grained personal access token to access resources that belong to a resource owner that requires approval for token access. For more information, see “Creating a personal access token.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Personal access token requests” organization permission.
Note: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change.
Ping
This event occurs when you create a new webhook. The ping event is a confirmation from GitHub that you configured the webhook correctly.
ProjectCard
This event occurs when there is activity relating to a card on a classic project. For more information, see “About projects (classic).”
For activity relating to a project or a column on a project, see the
Project
and ProjectColumn
event. For activity relating to Projects instead of Projects (classic), use the
ProjectsV2
event instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Projects” repository or organization permission.
Project
This event occurs when there is activity relating to a classic project. For more information, see “About projects (classic).”
For activity relating to a card or column on a project, see the
ProjectCard
and
ProjectColumn
event. For activity relating to Projects
instead of Projects (classic), use the ProjectsV2
event
instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Projects” repository or organization permission.
ProjectColumn
This event occurs when there is activity relating to a column on a classic project. For more information, see “About projects (classic).”
For activity relating to a project or a card on a project, see the
Project
and ProjectCard
event. For activity relating to Projects instead of Projects (classic), see the
ProjectsV2
event instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Projects” repository or organization permission.
ProjectsV2
This event occurs when there is activity relating to an organization-level project. For more information, see “About Projects.”
For activity relating to a item on a project, see the
ProjectsV2Item
event. For activity relating to Projects
(classic), see the Project
,
ProjectCard
, and
ProjectColumn
events instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Projects” organization permission.
Note: Webhook events for projects are currently in beta and subject to change. To share feedback about projects webhooks with GitHub, see the Projects webhook feedback discussion.
ProjectsV2Item
This event occurs when there is activity relating to an item on an organization-level project. For more information, see “About Projects.”
For activity relating to a project (instead of an item on a project), see the
ProjectsV2
event. For activity relating to Projects
(classic), see the Project
,
ProjectCard
and
ProjectColumn
events instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Projects” organization permission.
Note: Webhook events for projects are currently in beta and subject to change. To share feedback about projects webhooks with GitHub, see the Projects webhook feedback discussion.
Public
This event occurs when repository visibility changes from private to public. For more information, see “Setting repository visibility.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Metadata” repository permission.
PullRequest
This event occurs when there is activity on a pull request. For more information, see “About pull requests.”
For activity related to pull request reviews, pull request review comments, pull request
comments, or pull request review threads, see the
PullRequestReview
,
PullRequestReviewComment
,
IssueComment
, or
PullRequestReviewThread
events instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Pull requests” repository permission.
PullRequestReview
This event occurs when there is activity relating to a pull request review. A pull request review is a group of pull request review comments in addition to a body comment and a state. For more information, see “About pull request reviews.”
For activity related to pull request review comments, pull request comments, or pull request
review threads, see the
PullRequestReviewComment
,
IssueComment
, or
PullRequestReviewThread
events instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Pull requests” repository permission.
PullRequestReviewComment
This event occurs when there is activity relating to a pull request review comment. A pull request review comment is a comment on a pull request’s diff. For more information, see “Commenting on a pull request.”
For activity related to pull request reviews, pull request comments, or pull request review
threads, see the PullRequestReview
,
IssueComment
, or
PullRequestReviewThread
, events instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Pull requests” repository permission.
PullRequestReviewThread
This event occurs when there is activity relating to a comment thread on a pull request. For more information, see “About pull request reviews.”
For activity related to pull request review comments, pull request comments, or pull request
reviews, see the PullRequestReviewComment
,
IssueComment
, or
PullRequestReview
events instead.
To subscribe to this event, a GitHub App must have at least read-level access for the “Pull requests” repository permission.
Push
This event occurs when a commit or tag is pushed.
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
Note: An event will not be created when more than three tags are pushed at once.
RegistryPackage
This event occurs when there is activity relating to GitHub Packages. For more information, see “Introduction to GitHub Packages.”
To install this event on a GitHub App, the app must have at least read-level access for the “Packages” repository permission.
Note: GitHub recommends that you use the newer package event instead.
Release
This event occurs when there is activity relating to releases. For more information, see “About releases.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
RepositoryAdvisory
This event occurs when there is activity relating to a repository security advisory. For more information about repository security advisories, see “About GitHub Security Advisories for repositories.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Repository security advisories” permission.
Repository
This event occurs when there is activity relating to repositories. For more information, see “About repositories.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Metadata” repository permission.
RepositoryDispatch
This event occurs when a GitHub App sends a POST request to /repos/{owner}/{repo}/dispatches. For more information, see the REST API documentation for creating a repository dispatch event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
RepositoryImport
This event occurs when a repository is imported to GitHub. For more information, see “Importing a repository with GitHub Importer.” For more information about the API to manage imports, see the REST API documentation.
RepositoryVulnerabilityAlert
This event occurs when there is activity relating to a security vulnerability alert in a repository.
Note: This event is deprecated. see the
DependabotAlert
event instead.
Schedule
The schedule event allows you to trigger a workflow at a scheduled time.
You can schedule a workflow to run at specific UTC times using POSIX cron syntax. Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes.
SecretScanningAlert
This event occurs when there is activity relating to a secret scanning alert. For more information about secret scanning, see “About secret scanning.”
For activity relating to secret scanning alert locations, use the
SecretScanningAlertLocation
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Secret scanning alerts” repository permission.
SecretScanningAlertLocation
This event occurs when there is activity relating to the locations of a secret in a secret scanning alert.
For more information about secret scanning, see “About secret scanning.”
For activity relating to secret scanning alerts, see the
SecretScanningAlert
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Secret scanning alerts” repository permission.
SecurityAdvisory
This event occurs when there is activity relating to a security advisory that was reviewed by GitHub. A GitHub-reviewed security advisory provides information about security-related vulnerabilities in software on GitHub. For more information about security advisories, see “About GitHub Security Advisories for repositories.”
GitHub Dependabot alerts are also powered by the security advisory dataset. For more information, see “About Dependabot alerts.”
SecurityAndAnalysis
This event occurs when code security and analysis features are enabled or disabled for a repository. For more information, see “GitHub security features.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Administration” repository permission.
Sponsorship
This event occurs when there is activity relating to a sponsorship listing. For more information, see “About GitHub Sponsors.”
You can only create a sponsorship webhook on GitHub.com. For more information, see “Configuring webhooks for events in your sponsored account.”
Star
This event occurs when there is activity relating to repository stars. For more information about stars, see “Saving repositories with stars.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Metadata” repository permission.
Status
This event occurs when the status of a Git commit changes. For example, commits can be marked as error, failure, pending, or success. For more information, see “About status checks.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Commit statuses” repository permission.
TeamAdd
This event occurs when a team is added to a repository. For more information, see “Managing teams and people with access to your repository.”
For activity relating to teams, see the teams event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Members” organization permission.
Team
This event occurs when there is activity relating to teams in an organization. For more information, see “About teams.”
To subscribe to this event, a GitHub App must have at least read-level access for the “Members” organization permission.
Watch
This event occurs when there is activity relating to watching, or subscribing to, a repository. For more information about watching, see “Managing your subscriptions.” For information about the APIs to manage watching, see “Watching” in the REST API documentation.
To subscribe to this event, a GitHub App must have at least read-level access for the “Metadata” repository permission.
WorkflowDispatch
This event occurs when a GitHub Actions workflow is manually triggered. For more information, see “Manually running a workflow.”
For activity relating to workflow runs, see the
WorkflowRun
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Contents” repository permission.
WorkflowJob
This event occurs when there is activity relating to a job in a GitHub Actions workflow. For more information, see “Using jobs in a workflow.”
For activity relating to a workflow run instead of a job in a workflow run, use the
WorkflowRun
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Actions” repository permission.
WorkflowRun
This event occurs when there is activity relating to a run of a GitHub Actions workflow. For more information, see “About workflows.”
For activity relating to a job in a workflow run, see the
WorkflowJob
event.
To subscribe to this event, a GitHub App must have at least read-level access for the “Actions” repository permission.
Unknown(String)
A webhook event that is currently unsupported by octocrab.
When a WebhookEvent
has this kind, then the
specific payload will only be a generic serde_json::Value
.
Implementations§
source§impl WebhookEventType
impl WebhookEventType
sourcepub fn parse_specific_payload(
&self,
data: Value
) -> Result<WebhookEventPayload, Error>
pub fn parse_specific_payload( &self, data: Value ) -> Result<WebhookEventPayload, Error>
Parse (and verify) the payload for the specific event kind.
Trait Implementations§
source§impl Clone for WebhookEventType
impl Clone for WebhookEventType
source§fn clone(&self) -> WebhookEventType
fn clone(&self) -> WebhookEventType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WebhookEventType
impl Debug for WebhookEventType
source§impl<'de> Deserialize<'de> for WebhookEventType
impl<'de> Deserialize<'de> for WebhookEventType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for WebhookEventType
impl PartialEq for WebhookEventType
source§fn eq(&self, other: &WebhookEventType) -> bool
fn eq(&self, other: &WebhookEventType) -> bool
self
and other
values to be equal, and is used
by ==
.