This assumes that you have a cadence that you want to build velocity charts for. You probably want to get all closed issues and put them in a milestone for a particular sprint. This script automates that for you.
Given a date, which you provide as an option, we will find all issues that were closed in the past N days (default: 7) and add them to a milestone that is named to correspond with the beginning and end date. The milestone name format is:
"YYYY-MM-DD - YYYY-MM-DD"
If the milestone matching this format already exists, it will clear all existing issues from it and re-attach the closed issues.
Note on older milestone dates: Because the GitHub API is not great at filtering issues on a private repo (docs) one cannot easily filter down issues closed between two dates. The only date you can really filter on is last updated, which is a poor proxy. This doesn't paginate results, so if you are looking for dates very far back they may not fall within the first page of 100 results and will therefore not be returned in the search and moved.
Python3 only. You probably want to use virtualenv, etc.
$ pip install https://github.com/briandailey/amanuensis/archive/master.zip
$ amanuensis --repo briandailey/amanuensis --date 2017-10-27
Using Milestone 127: 2017-10-20 - 2017-10-27
Found 66 matching issues. Pairing down.
Found 29 issues closed between 2017-10-20 and 2017-10-27.
4685 - Lorem ipsum dolor sit - https://github.com/briandailey/amanuensis/issues/4685