Created
July 6, 2026 19:46
-
-
Save MrDHat/b9c008dbe8d387832c0321fac697bcf2 to your computer and use it in GitHub Desktop.
Unofficial API to upload to github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -s \ | |
| "https://uploads.github.com/user-attachments/assets?name=screenshot.png&content_type=image/png&repository_id=${REPO_ID}" \ | |
| -X POST \ | |
| -H "Authorization: Bearer $(gh auth token)" \ | |
| -H "Content-Type: application/octet-stream" \ | |
| -H "Accept: application/json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| --data-binary "@screenshot.png" \ | |
| | jq -r '.url' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment