Upload Github Attachment upload-github-attachment
Upload a local image or file to GitHub's user-attachments storage and return a URL suitable for issue, pull request, discussion, or comment Markdown.
Use it when codex must embed local screenshots, videos, logs, or other evidence in GitHub content without committing the files to a repository.
- Our test
- —
- not tested yet
- GitHub stars
- 52k
- moeru-ai/airi
- Added by
- 0
- members
- Updated
- Dec 6
- commit f28d10e
- Content
- 3 files
- 1 script · 5 KB
- License
- MIT
- free to use
What our test found
Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.
name: upload-github-attachment description: Upload a local image or file to GitHub's user-attachments storage and return a URL suitable for issue, pull request, discussion, or comment Markdown. Use when Codex must embed local screenshots, videos, logs, or other evidence in GitHub content without committing the files to a repository.
Upload GitHub Attachment
Use the bundled script so authentication, repository resolution, MIME detection, and URL extraction remain consistent.
Requirements
- Require the
ghCLI andcurl. - Prefer an existing
gh auth loginsession. - When interactive
ghauthentication is unavailable, requireGH_TOKENorGITHUB_TOKENin the environment. - Stop and ask the user to configure one of those authentication methods if
gh auth tokencannot resolve a token. Never print, persist, or interpolate the token into diagnostic output.
Upload
Run from a checkout of the destination repository:
.agents/skills/upload-github-attachment/scripts/upload-github-attachment.sh /absolute/path/to/image.pngSpecify the repository when the current directory cannot resolve it:
.agents/skills/upload-github-attachment/scripts/upload-github-attachment.sh \
--repo moeru-ai/airi \
/absolute/path/to/image.pngThe script prints only the final https://github.com/user-attachments/assets/... URL. Embed it with  for an image or [label](URL) for another file.
Verification
- Require a successful upload command and a returned
https://github.com/user-attachments/assets/...URL. - Use that URL for the intended local file. Do not issue GET or HEAD requests to verify the uploaded asset.
- Do not treat anonymous access returning 404 as an upload failure or a reason to stop the workflow.
- After creating or editing GitHub content, reopen it and verify the attachment Markdown uses the returned URL.
The upload endpoint is currently undocumented by GitHub. Treat a rejected upload request as a blocking capability change instead of committing PR-only artifacts. Background and the observed Bearer-token flow: <https://island94.org/2026/08/programmatically-upload-attachments-to-github-issues-pull-requests-comments>.