mirror of
https://github.com/dorny/paths-filter.git
synced 2026-03-30 23:10:09 +00:00
refactor: update PullRequest type usage in getChangedFilesFromApi and related functions
This commit is contained in:
parent
9cca65527a
commit
881584d466
@ -2,7 +2,7 @@ import * as fs from 'fs'
|
||||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import {GetResponseDataTypeFromEndpointMethod} from '@octokit/types'
|
||||
import {PushEvent, PullRequestEvent, MergeGroupEvent} from '@octokit/webhooks-types'
|
||||
import {MergeGroupEvent, PullRequest, PushEvent} from '@octokit/webhooks-types'
|
||||
|
||||
import {
|
||||
isPredicateQuantifier,
|
||||
@ -97,7 +97,7 @@ async function getChangedFiles(token: string, base: string, ref: string, initial
|
||||
if (base) {
|
||||
core.warning(`'base' input parameter is ignored when action is triggered by pull request event`)
|
||||
}
|
||||
const pr = github.context.payload as PullRequestEvent
|
||||
const pr = github.context.payload.pull_request as PullRequest
|
||||
if (token) {
|
||||
return await getChangedFilesFromApi(token, pr)
|
||||
}
|
||||
@ -193,7 +193,7 @@ async function getChangedFilesFromGit(base: string, head: string, initialFetchDe
|
||||
}
|
||||
|
||||
// Uses github REST api to get list of files changed in PR
|
||||
async function getChangedFilesFromApi(token: string, pullRequest: PullRequestEvent): Promise<File[]> {
|
||||
async function getChangedFilesFromApi(token: string, pullRequest: PullRequest): Promise<File[]> {
|
||||
core.startGroup(`Fetching list of changed files for PR#${pullRequest.number} from Github API`)
|
||||
try {
|
||||
const client = github.getOctokit(token)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user