WIP: Fix recent languages after GitHub API change (Cannot destructure property 'committer' of 'undefined') #1754
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.
It is provided for discussion and community visibility. The quality of this code is not suitable for merging as-is.
This PR fixes the following error causing failure to update svg and failed action runs;
GitHub recently changed the APIs used to get some of the commit information used in the recent languages portion of the code. API version was not bumped, and the breaking changes documentation was not updated, so it took me a while to figure out what had gone wrong. Once I did, however, I found this blog post that hints at what they where doing and why; https://github.blog/changelog/2025-08-08-upcoming-changes-to-github-events-api-payloads/
Specifically, this part of the
PushEvent
no longer exists:metrics/tests/mocks/api/github/rest/activity/listEventsForAuthenticatedUser.mjs
Lines 271 to 280 in 582a522
I'm not familiar with the code base, nor particularly familiar with the code style (additionally, auto-formatter managed to sneak in some whitespace – ignore that.), so the implementation may not be the best. I'm fairly certain that I managed to re-implement it properly however.
Do note the change from using committer to author in the authored by message, as committer would be GitHub for any file edited in the web interface (but set to the appropriate info in the authored structure). Not sure if that string is used anywhere, but that seemed more correct.
I am trying to do some smarts here in how many pages of commits we retrieve, based on the commits the event listed as head and base (we could use those two fields to get the patch of the changeset, but then we couldn't filter author on a commit-by-commit basis
gh api -H "Accept: application/vnd.github.patch" /repos/oddstr13/github-profile-metrics/compare/c32878ca41906dba3e10fc9f19b2b12bc4298cd8...de58e40391d57e531a9e7330f7935d3637f85efd
).This branch contain unrelated changes, mainly in the dockerfile, as this is my testing branch (and what is currently used to update my profile badge).
Closes #1753 as it only hides the exception
#1739 is related, in that it seems to be hiding the same issue in a different part of the code base, I have not looked into this yet, but that PR doesn't fix the underlying issue either, just hides it