Closed bzarboni1 closed 2 months ago
After inspecting the documentation, there is a 100-entry limit to what the GH API will return, before paginating. We don't account for this, and as such only the first 100 entries will be returned.
We use a curl command to retrieve the audit logs:
curl
curl -H "Authorization: token ${{ steps.generate_token.outputs.token }}" https://api.github.com/orgs/${{ matrix.org }}/audit-log?phrase=created:${yesterday} > audit-log-${yesterday}.json
which doesn't account for pagination. GitHub has a Javascript example / package, with which we should query:
import { Octokit } from "octokit"; const octokit = new Octokit({ }); const data = await octokit.paginate("GET /repos/{owner}/{repo}/issues", { owner: "octocat", repo: "Spoon-Knife", per_page: 100, headers: { "X-GitHub-Api-Version": "2022-11-28", }, }); console.log(data)
ISSUE
113
After inspecting the documentation, there is a 100-entry limit to what the GH API will return, before paginating. We don't account for this, and as such only the first 100 entries will be returned.
ANALYSIS
We use a
curl
command to retrieve the audit logs:which doesn't account for pagination. GitHub has a Javascript example / package, with which we should query: