````
Upload PR/issue screenshots and videos to GitHub. Do not commit media.
Use `$GITHUB_ATTACHMENTS_TOKEN`. If it is unset, skip the upload.
Capture media during reproduction and verification. Preserve existing
`user-attachments` embeds when rewriting a PR or issue body. If a later
change alters the UI being shown, recapture and replace those embeds.
Upload when writing the PR or issue body:
```
curl -sS -X POST \
"https://uploads.github.com/user-attachments/assets?name=<file>&content_type=<mime>&repository_id=$(gh api repos/<owner>/<repo> --jq .id)" \
-H "Authorization: Bearer $GITHUB_ATTACHMENTS_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: <mime>" \
--data-binary @<file>
```
A successful upload returns JSON containing a GitHub
`user-attachments` URL.
Images: `
Videos: put the bare URL on its own line.
Supported MIME types:
`image/png`, `image/jpeg`, `image/gif`, `image/webp`, `video/mp4`
Convert WebM when needed:
`ffmpeg -i in.webm -c:v libx264 -pix_fmt yuv420p out.mp4`
````
Proof Shared Document
Proof Shared Document
This is a collaborative document on Proof. To read or edit it programmatically:
Fetch this URL with Accept: application/json to get content + API links.
Fetch this URL with Accept: text/markdown to get raw markdown.