Repository navigation
Description
Describe the feature or problem you'd like to solve
The --attach stack (#14186) allowlists OAuth, classic PAT, and fine-grained PAT credentials, so a GitHub App installation token (ghs_) is rejected client-side with "unsupported authentication type".
We tested whether that allowlist is conservative or reflects the endpoint's actual behavior, since our automation runs on an installation token. Calling the endpoint directly from a GitHub Actions run (GITHUB_TOKEN, permissions: contents: write, private repo the token can push to):
POST https://uploads.github.com/user-attachments/assets?name=test.png&content_type=image/png&repository_id=<numeric id>
→ 404 {"message":"Not Found"}
The identical request with an OAuth token (gho_, same repo, WRITE permission) succeeds and returns an asset URL that renders in issues/PRs. So the exclusion is a property of the platform endpoint, not a CLI decision.
Why it matters
Bots and CI are heavy producers of images on issues and PRs: verification screenshots, visual diffs, test artifacts. GitHub App tokens are the recommended identity for exactly that automation, yet they are the one credential class that cannot use the native attachment path. Our workaround today is committing images to a dedicated assets branch and embedding raw/ URLs — the kind of hack --attach was built to retire.
Proposed solution
- If the token-type restriction is intentional platform behavior, say so here and route the ask upstream (GitHub CLI: Image upload and attach for issues, PRs, and comments [GA] github/roadmap#1324 makes no mention of credential-type requirements).
- If the endpoint can be extended to installation tokens with write access, please allow them and widen
uploadTokenTypesaccordingly. - Either way, document the credential requirement in the
--attachhelp, alongside the permission requirement requested in--attachrequires write access, so outside reporters cannot attach screenshots #14302.
To those with enterprise accounts, in addition to adding a 👍 on this issue, please route the request through your account manager and/or support tickets so we can get connected.
Activity
cli-triage commentedon Sep 1, 2026
Thanks for the detailed report and reproduction. This looks like a legitimate enhancement/documentation request: the
--attachallowlist (from #14186) rejects GitHub App installation tokens (ghs_), and you've verified the upload endpoint itself 404s for that token type even with write access. I'm suggestingenhancement(to track wideninguploadTokenTypesif the endpoint supports it, or documenting the limitation) andgh-prsince--attachis used in PR/issue workflows. No duplicates found in existing issues (#14194 covers general attachment support and #8747 covers GitHub App auth, but neither addresses this specific token-allowlist/endpoint restriction). A maintainer should confirm whether this is a platform-side restriction to route upstream or a CLI-side allowlist that can be relaxed.BagToad commentedon Sep 2, 2026
Thanks for the request @Ninodevo. This is intended behavior for now, but we may re-evaluate in the future based on demand.
github-actions commentedon Sep 2, 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.
comp615 commentedon Sep 8, 2026
Highlighting that we were attempting to change our awkward media -> S3 -> link -> Github process now to use this, and also found it to be ineffective since bots can't use it (and they do a lot of our visual validation).
drogers0 commentedon Sep 8, 2026
While waiting on something first party, gh-image attaches from Actions today. It uses the web upload flow, so no App token is involved: set
GH_SESSION_TOKENfrom a dedicated bot account.It also handles logs, zips and PDFs, not just images and video.
dashashifrina commentedon Sep 10, 2026
+1 this, we are having to do some really silly workarounds and using a dedicated PAT when our whole app functions with app installation tokens. This feels like an arbitrary limitation when installation tokens grant most of the same functionality already.
matthew-gerstman commentedon Sep 10, 2026
This makes it much harder for agents to demonstrate on a PR that they've actually verified code works.
EZArchy commentedon Sep 10, 2026
@Ninodevo thanks for posting this. Our security policy prohibits long-lived PATs and OAuth tokens for automation. GitHub App installation tokens are the only credential class we're allowed to use in CI. As written, --attach is unusable for us entirely. The feature is great, but excluding the most secure, most recommended token type makes it a human-only tool. We'd love to adopt it the day ghs_ tokens are supported.
@BagToad we would really need this to be supported.
agustif commentedon Sep 10, 2026
+1 please fix this
Unusable with unsecure PATs
32 remaining items
Keep CLASSIC_TOKEN for the user-attachments upload
Keep CLASSIC_TOKEN for the user-attachments upload
Keep CLASSIC_TOKEN for the user-attachments upload
Keep CLASSIC_TOKEN for the user-attachments upload
dkattan commentedon Oct 30, 2026
We are so close guys. Please let the App Installation tokens do this. I don't want to share my PAT with any more bots.
vegardx commentedon Nov 1, 2026
Same here on GitHub Enterprise Cloud with data residency. With GITHUB_TOKEN (contents: write, pull-requests: write), gh passes its checks and the upload to uploads.$tenant.ghe.com/user-attachments/assets gets a 404, which gh reports as "attaching files requires write access" even though the token has it.
Two asks:
The second matters if you want agentic workflows to be usable. Agents and Actions open pull requests that people review, and a visual change needs screenshots as proof. Right now a workflow can capture them but can't attach them without a long-lived bot PAT, which goes against the advice to use short-lived installation tokens. That looks like a big gap.
We're raising it through our account manager too.
Keep CLASSIC_TOKEN for the user-attachments upload
junebash commentedon Nov 7, 2026
Agreed, this totally breaks my agent workflows. The workaround is really quite annoying, and I don't understand the reasoning behind it.
Add GLOSSARY.md: settle on Refund request (#1)
Stage a fix for gh pr comment --attach (can't push to .github/workflo…
feat: Configure the AWS CLI for Cloudflare R2 through OpenBao
publish_draft: give an image a raw URL a comment renders
Revert the PAT routing, which this project decided against
fabiendevos commentedon Nov 18, 2026
Any news on this? Looks like a lot of people (us included) would really like this feature :) I don't want a useless branch or some other silly workaround like using an s3 bucket just for this :)
kinda-dev commentedon Nov 18, 2026
Hey, this would be amazing to have if it ships and would remove plenty of pain from manual implementation on our end.
Rooting for you!!!