async function getAllFilesForPullRequest(client, owner, repo, pullNumber) {
  const perPage = 100 // Max number of items per page
  let page = 1 // Start with the first page
  let allFiles = []
  while (true) {
    const response = await client.rest.pulls.listFiles({
      owner,
      repo,
      pull_number: pullNumber,
      per_page: perPage,
      page,
    })

    if (response.data.length === 0) {
      // Break the loop if no more results
      break
    }

    allFiles = allFiles.concat(response.data)
    page++ // Move to the next page
  }
  return allFiles
}
Returns info about all files changed in a PR (max 3000 results)

@param {object} client hydrated octokit ready to use for GitHub Actions
@param {string} owner repo owner
@param {string} repo repo name
@param {number} pullNumber pull request number
@returns {object[]} array of object that describe pr changed files - see https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests-files