Repository navigation
Description
Describe the feature or problem you’d like to solve
First, thank you for shipping this. #13256 and the stack at #14186 closed a request that had been open in one form or another since #1895 in 2020, and the design is better than the workarounds it replaces — being able to write ordinary markdown against local paths and have those references rewritten on upload means a report drafted offline stays readable before it is ever posted. I am very glad to see it land.
One gap, from the read-only side of the fence.
--attach accepts a credential only when its permission on the target repository is ADMIN, MAINTAIN or WRITE:
// uploadPermissions lists the repository permissions that can attach a file.
// The list matches api.Repository.ViewerCanPush, and it is measured against the
// upload endpoint: READ and TRIAGE get a 404.
var uploadPermissions = []string{"ADMIN", "MAINTAIN", "WRITE"}— internal/attachments/client.go
That excludes the group that most often needs to attach a screenshot to an issue: the outside reporter, who has READ. I use gh to follow up on my own open issues, and viewerPermission is READ on every repository I track — this one included — so --attach is unavailable for all of them:
| repository | viewerPermission |
|---|---|
cli/cli |
READ |
openai/codex |
READ |
microsoft/vscode |
READ |
anthropics/claude-code |
READ |
tauri-apps/tray-icon |
READ |
Meanwhile the same account can drag a screenshot into a comment on any of those repositories through the web UI and it renders. That asymmetry is visible in this tracker: in #12960, drogers0 — author_association: NONE on this repository — posted a github.com/user-attachments/assets/… image scoped to cli/cli, using an extension that replicates the web upload flow with a browser session cookie. So the platform does permit a read-only user to create one of these assets. It is the token-authenticated path that refuses.
Proposed solution
- If the
404forREAD/TRIAGEis a property ofPOST /user-attachments/assetsrather than a CLI decision, say so — here, and ideally on GitHub CLI: Image upload and attach for issues, PRs, and comments [GA] github/roadmap#1324, which describes the feature with no mention of a permission requirement. That tells people where the ask actually belongs, which is the same courtesy support image/file attachments in gh issue create and gh issue comment (critical for agentic workflows) #12960 got when the blocker was the missing API. - If the endpoint can serve a user who is permitted to comment on the repository, please allow that. Permission to comment, rather than permission to push, is what gates the equivalent web-UI upload.
- Either way, document the requirement in the
--attachhelp. The long help forgh issue createcovers the 50-file limit, the alt-text syntax and the partial-failure behaviour, but neither the permission requirement nor the GitHub Enterprise Server exclusion, so a read-only user meets both only as an error.
Point 3 stands on its own and is worth doing even if 1 and 2 are declined.
Additional context
I have not run the preview build — the artifacts linked from #13256 expired on 25 August, and this has not shipped in a release yet (latest is 2.98.0 from 2026-08-20; the stack merged 2026-08-25). The above is read from the merged code on trunk, so please correct me if the released behaviour differs.
Activity
cli-triage commentedon Aug 31, 2026
Thanks for the detailed writeup. I'm suggesting the
enhancementlabel: this describes a real gap in the recently-shipped--attachfeature (#13256/#14186) where the upload endpoint's permission check (ADMIN/MAINTAIN/WRITE) excludes read-only outside reporters from attaching files, even though the same accounts can upload via the web UI. I checked for duplicates and didn't find an exact match — #14194 and #12960 request the underlying attach capability itself, which has since shipped, so this is a distinct follow-up about the permission requirement and its documentation. A maintainer should confirm whether theREAD/TRIAGErestriction is enforced by the platform API itself or is a CLI-side choice, since that determines whether points 1–2 are actionable here versus upstream, though point 3 (documenting the requirement in--attachhelp) seems actionable regardless.github-actions commentedon Sep 1, 2026
github-actions commentedon Sep 1, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
drogers0 commentedon Sep 8, 2026
While waiting on something first party, gh-image attaches from read-only access today, so outside reporters can post screenshots.
It uses the same upload path as drag and drop in the web UI, which only needs pull permission.
tekumara commentedon Sep 13, 2026
Yep when using --attach I encounter:
attaching files requires write access to the repositoryfor repos I don't own.Via the UI I can add a screenshot however.
I'm using my personal github token.
fix(ci): read the screenshots a no-write-access contributor commits
11 remaining items
evidence(composer-pills): commit the CLI-mode and min-width frames th…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
fix(ci): read the screenshots a no-write-access contributor commits (k…
evidence(composer-pills): commit the CLI-mode and min-width frames th…
adehad commentedon Oct 30, 2026
Another case this blocks: pull requests from forks. Opening sheprd-labs/sheprd#922 from a fork, the repo's PR template asks for before/after screenshots, but
gh pr create --attachstopped withattaching files requires write access to the repositorybefore creating anything. The same happened withgh issue create --attachfor the linked issue (sheprd-labs/sheprd#921). Both were opened without images, and the screenshots were dragged in through the web UI afterwards.On point 3: in gh 2.103.0,
--helpforgh pr createandgh issue createstill doesn't mention the permission requirement. It's documented only in theghagent skill (skills/gh/SKILL.md, "Attaching images and videos").Ludocius commentedon Nov 10, 2026
Same case here, from an outside reviewer (gh 2.103.0, Windows).
I reviewed a contributor's PR on a repo where I only have read access, generated the evidence locally (test runs, generated-project builds) and tried to post the screenshots:
On github.com the same account can drag those images into the comment box of that PR without any extra permission. Since
gh pr commentalready succeeds without write access, it would help if--attachused the same rule as the web comment box: if you can comment, you can attach.