Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use @octokit/webhooks-types for the types of webhook payload #65

Merged
merged 1 commit into from
Nov 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
refactor: use @octokit/webhooks-types for the types of payload
  • Loading branch information
kentaro-m committed Nov 27, 2021
commit 5a24ba633e3ab70691756ac18d3b7baeed47726f
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"lodash": "^4.17.20"
},
"devDependencies": {
"@octokit/webhooks-types": "^4.17.1",
"@types/jest": "^27.0.2",
"@types/js-yaml": "^3.12.1",
"@types/lodash": "^4.14.141",
Expand Down
4 changes: 3 additions & 1 deletion src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as github from '@actions/github'
import { Context } from '@actions/github/lib/context'
import * as utils from './utils'
import { PullRequest } from './pull_request'
import { PullRequestEvent } from '@octokit/webhooks-types'

export interface Config {
addReviewers: boolean
Expand Down Expand Up @@ -32,7 +33,8 @@ export async function handlePullRequest(
throw new Error('the webhook payload is not exist')
}

const { title, draft, user, number } = context.payload.pull_request
const { pull_request: event } = context.payload as PullRequestEvent
const { title, draft, user, number } = event
const {
skipKeywords,
useReviewGroups,
Expand Down