EvitanRelta/markgh

Upload images to Github server

Opened this issue · 0 comments

Pasting images into Github's issue editor uploads said image to their server.
U can then copy the image link, close the editor without saving, and boom, u've just uploaded said image to Github's server.
Thus, it should be possible to do it programmatically.

Checking the browser's HTTP requests traffic, it seems to interact with an undocumented API endpoint – https://github.com/upload/policies/assets

It's not implemented in the Github API library: Octokit.
And I couldnt find any official documentation of the API endpoint.
but there's some bootleg implementations floating around online. Here's one of them: https://github.com/maple3142/ghfileupl/blob/master/index.js