Skip to content

Instantly share code, notes, and snippets.

@MrDHat
Created July 6, 2026 19:46
Show Gist options
  • Select an option

  • Save MrDHat/b9c008dbe8d387832c0321fac697bcf2 to your computer and use it in GitHub Desktop.

Select an option

Save MrDHat/b9c008dbe8d387832c0321fac697bcf2 to your computer and use it in GitHub Desktop.
Unofficial API to upload to github
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