Closed ndunnett closed 4 months ago
Fixed an edge case where if people added an external repo and didn't put a slash in the link title it would break the link and change the repo name to undefined. Example: 2022.md under M4, repo aoc_eblake
. This was a pre-existing bug but probably never mattered because the repos in question were added to files that weren't processed in CI before. Also simplified the file parsing to reduce the amount of if/else nesting.
Looks great! Thank you so much!
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. :satisfied: