Skip to content

Commit

Permalink
use pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-dunn-sublime committed Dec 27, 2023
1 parent 75a7bcd commit 8f8fe75
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/rule-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,31 @@ jobs:
with:
debug: ${{ secrets.ACTIONS_STEP_DEBUG || false }}
script: |
// https://octokit.github.io/rest.js/v18#checks-create
let response = await github.rest.issues.listComments({
# // https://octokit.github.io/rest.js/v18#checks-create
# let response = await github.rest.issues.listComments({
# owner: context.repo.owner,
# repo: context.repo.repo,
# issue_number: "${{ steps.find_pr_number.outputs.result }}",
# });
#
# console.log(JSON.stringify(response))

const opts = github.rest.issues.listComments.endpoint.merge({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: "${{ steps.find_pr_number.outputs.result }}",
});
})
const comments = await github.paginate(opts)

console.log(JSON.stringify(comments))
for (const comment of comments) {
if (comment.author_association !== "MEMBER") {
console.log("Ignoring comment from " + comment.user.login)
}

console.log("Body: " + comment.body)
}
console.log(JSON.stringify(response))
- name: "Trigger MQL Mimic Tests"
Expand Down

0 comments on commit 8f8fe75

Please sign in to comment.