It could be linked to github-api/github-api issue 638:
When we invoke org/kohsuke/github/GHContentBuilder.java#commit()
with content
length > 57
The API fails with 422, invalid Base 64 encoding
If we have a content 1234567890123456789012345678901234567890123456789012345678
of length 58.
I was able to fix this issue locally by using Base64.getEncoder().encodeToString()
This is however linked to a recent change.
Note that "GitHub Rest API V3 'Other Authentication Methods'" includes:
The API supports Basic Authentication as defined in RFC2617 with a few slight differences.
The main difference is that the RFC requires unauthenticated requests to be answered with 401 Unauthorized responses.
In many places, this would disclose the existence of user data. Instead, the GitHub API responds with 404 Not Found.
This may cause problems for HTTP libraries that assume a 401 Unauthorized response. The solution is to manually craft the Authorization header.
So a MIME encoding might nit be supported by github-api/github-api
because of those RFC2617 requirements which are not followed.
Liam Newman from CloudBees comments:
The change you linked (#631 'Remove dependency on apache commons-codec') hasn't been publish in a release yet - if you're you using v1.101 it doesn't have this change.
I'm pretty sure I specifically used the MIME encoding because the non-MIME produced an error. Also, if you look at what comes back from GitHub it is MIME encoded.
See "Decoding base64 while using GitHub API to Download a File"