Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This rewrite changes how the action queries the GitHub API to drastically reduce the request rate, this allows processing multiple files so now the markdown files for all years can be updated rather than just the current year. See issue #1837 for context.
Dependency/version changes:
npm12
->npm20
actions/checkout
fromv2
->v4
actions/core
from1.2.6
->1.10.1
actions/github
from3.0.0
->6.0.0
moment
from2.26.0
->2.30.1
axios
Code changes:
update-badge
now takes a space delimited list of filenames as an input rather than an input filename and output filename. It will process each file listed and write changes to the same file. ThefileNames
input inworkflows/update-badge.yml
will need to be updated each year when the new calendar is started.update-badge
now uses GraphQL rather than REST to query each repo's most recent commit. This is because using REST when processing multiple files caused it to get rate limited. The GraphQL queries are done in chunks of 200 repos to avoid getting timed out (too many at once would take >10 seconds to process).update-badge
to more logically separate file processing inindex.js
from querying the GitHub API inupdateRepos.js
and generating badges ingenerateBadge.js
.Apologies if I messed anything up, I ran the CI and did some testing locally and it seems to be working as intended. I'm not quite proficient at JS, it's not exactly my lang of choice. 😆