diff --git a/src/main.ts b/src/main.ts index 463e7f1..0aefbb0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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 { +async function getChangedFilesFromApi(token: string, pullRequest: PullRequest): Promise { core.startGroup(`Fetching list of changed files for PR#${pullRequest.number} from Github API`) try { const client = github.getOctokit(token)