import * as core from '@actions/core'; import * as github from '@actions/github'; import {ClientType} from './types'; export const getChangedFiles = async ( client: ClientType, prNumber: number ): Promise => { const listFilesOptions = client.rest.pulls.listFiles.endpoint.merge({ owner: github.context.repo.owner, repo: github.context.repo.repo, pull_number: prNumber }); const listFilesResponse = await client.paginate(listFilesOptions); const changedFiles = listFilesResponse.map((f: any) => f.filename); core.debug('found changed files:'); for (const file of changedFiles) { core.debug(' ' + file); } return changedFiles; };