Skip to content
Back to skills

upload-github-attachment

ASecurity

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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 9, 2026
ai-agentsbashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned October 9, 2026

npx -y skills add moeru-ai/upload-github-attachment-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of upload-github-attachment?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for upload-github-attachment
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/moeru-ai-upload-github-attachment/badge)](https://www.skillsdirectory.com/skills/moeru-ai-upload-github-attachment)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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 `gh` CLI and `curl`.
- Prefer an existing `gh auth login` session.
- When interactive `gh` authentication is unavailable, require `GH_TOKEN` or `GITHUB_TOKEN` in the environment.
- Stop and ask the user to configure one of those authentication methods if `gh auth token` cannot resolve a token. Never print, persist, or interpolate the token into diagnostic output.

## Upload

`<skill-dir>` is the directory that contains this `SKILL.md`. Run from a checkout of the destination repository:

```bash
<skill-dir>/scripts/upload-github-attachment.sh /absolute/path/to/image.png
```

Specify the repository when the current directory cannot resolve it:

```bash
<skill-dir>/scripts/upload-github-attachment.sh \
  --repo OWNER/REPO \
  /absolute/path/to/image.png
```

The script prints only the final `https://github.com/user-attachments/assets/...` URL. Embed it with `![](URL)` for an image or `[label](URL)` for another file.

## Verification

1. Require a successful upload command and a returned `https://github.com/user-attachments/assets/...` URL.
2. Use that URL for the intended local file. Do not issue GET or HEAD requests to verify the uploaded asset.
3. Do not treat anonymous access returning 404 as an upload failure or a reason to stop the workflow.
4. 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>.

Files in this skill

  • SKILL.md2.2 KB
  • agents/openai.yaml223 B
  • scripts/upload-github-attachment.sh2.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.