It updates the Github token fetching to use @octokit/app so that we do not fetch a new token for every single API request. Tokens are cached for 59 minutes.
It's good to reduce the calls we are making but also will reduce occurrences of https://github.com/danger/peril/issues/440 to at most once per hour. I will follow up with another PR to further address the issue.
Note: If you would prefer not to introduce a new dependency we could quite easily implement this caching within Peril.
This is a first step towards fixing https://github.com/danger/peril/issues/440.
It updates the Github token fetching to use
@octokit/app
so that we do not fetch a new token for every single API request. Tokens are cached for 59 minutes.It's good to reduce the calls we are making but also will reduce occurrences of https://github.com/danger/peril/issues/440 to at most once per hour. I will follow up with another PR to further address the issue.
Note: If you would prefer not to introduce a new dependency we could quite easily implement this caching within Peril.