Handle pagination when updating issues
MODIFY
.github/workflows/update-issues-on-release.yaml
.github/workflows/update-issues-on-release.yaml
@@ -26,15 +26,17 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
- const list = await github.issues.listForRepo({
+ const options = github.issues.listForRepo.endpoint.merge({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'all',
milestone: ${{steps.milestone.outputs.result}}
})
+ const issues = await github.paginate(options)
+
// Pull requests are issues so filter them out
- return list.data.filter( issue => !issue["pull_request"] )
+ return issues.filter( issue => !issue["pull_request"] )
- name: Comment and close issues
uses: actions/github-script@0.9.0
with:

Handle pagination when updating issues