Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ const newIssue = await octokit.rest.issues.create({

## Webhook payload typescript definitions

The npm module `@octokit/webhooks-definitions` provides type definitions for the response payloads. You can cast the payload to these types for better type information.
The npm module `@octokit/webhooks-types` provides type definitions for the response payloads. You can cast the payload to these types for better type information.

First, install the npm module `npm install @octokit/webhooks-definitions`
First, install the npm module `npm install @octokit/webhooks-types`

Then, assert the type based on the eventName
```ts
import * as core from '@actions/core'
import * as github from '@actions/github'
import {PushEvent} from '@octokit/webhooks-definitions/schema'
import {PushEvent} from '@octokit/webhooks-types'

if (github.context.eventName === 'push') {
const pushPayload = github.context.payload as PushEvent
Expand Down