auto-changelog-action
auto-changelog-action copied to clipboard
Add caching
It would be good to add some caching to this action. For my repo it will only run once per hour due to the rate limiting of the GH API:
Fetching tags...
RETRY - Octokit::TooManyRequests: 'GET https://api.github.com/repos/xxx/xxx/tags?per_page=100: 403 - API rate limit exceeded for installation ID 5418350. // See: https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting'
1 tries in 0.15924298 seconds and 1.0 seconds until the next try
Warning: Can't finish operation: GitHub API rate limit exceeded, changelog may be missing some issues. You can limit the number of issues fetched using the `--max-issues NUM` argument.
#<struct Octokit::RateLimit limit=1000, remaining=0, resets_at=2021-04-16 08:56:57 +0000, resets_in=3251>
Hey,
You might be able to bump the limit from 1000 -> 5000 requests by switching from GITHUB_TOKEN to a personal access token as stated here: rate-limiting.
I'm aware that this isn't a solution for this issue though. You might have to open a issue in the backend: github-changelog-generator - seems like conditional requests could be a valid solution to implement.
I'm not sure if, or how, this could be fixed in the action itself, since it's just a stateless docker container. I'm actually not sure how to get conditional requests to work in an environment like that, now that I think about it.
Also note that in github-changelog-generator you can specify to generated changes just from specified tag.... That and also in addition that you can have BASE.md file could help you mitigate the issue a little bit...
From time to time I will just move the generated changelog to BASE.md and I will specify tag to latest so no old PRs / Issues needs to be evaluated....
Hi, the same issue, I can't use the generator because of the github.GithubException.RateLimitExceededException
Taken from the generators --help
, cache should be enabled by default:
--[no-]http-cache Use HTTP Cache to cache GitHub API requests (useful for large repos). Default is true.
--cache-file CACHE-FILE Filename to use for cache. Default is github-changelog-http-cache in a temporary directory.
--cache-log CACHE-LOG Filename to use for cache log. Default is github-changelog-logger.log in a temporary directory.
--config-file CONFIG-FILE Path to configuration file. Default is .github_changelog_generator.
So you might be able to use the official cache action to get around this problem.
Looking at the generators code for http_cache, it seems like it uses tmpdir func to determine where to place this. I don't know how this plays out in the github action, but I guess it would end up in one of the following locations:
[ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.'].each do |dir|
If a solution is found, then please share it, so we can add it to the readme.