-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download attachment/file from an issue/pr #9046
Comments
@chubin : Thanks for bringing up this suggestion! ❤ Could you share a little more about the use case in question? How are you envisioning this being used by GitHub CLI users? I know there have been times where I've attached files to an issue for diagrams or PDFs, but I haven't really considered what I'd attach to issue / PR / discussion that'd I wouldn't commit to the repo. 🤔
Sadly, I think you're right: there are no APIs around attachments — whether release, issue, pull request, or discussion — to make something like this easy. Without them, the best anyone could do is pulling the main issue body and every issue comment looking for specific GitHub domains like |
Could you share a little more about the use case in question? How are you
envisioning this being used by GitHub CLI users?
The usecase is pretty straightforward and trivial:
I am writing a script that will "implement" (some) GitHub Issues using AI.
If there are any attachments in the issue (and in my case, there are),
the script will need access to them.
Before creating this issue, I did some research on the Internet
(Stack Overflow, Reddit), and I see that this use case is pretty
popular nowadays, and it will probably become even more popular in
the future.
I know there have been times where I've attached files to an issue for diagrams
or PDFs, but I haven't really considered what I'd attach to issue / PR /
discussion that'd I wouldn't commit to the repo. 🤔
It depends on the workflow.
It is possible to attach files to issues, so people will do so.
As developers, we must be able to process such issues.
Whether it's PDFs, diagrams, log files, or archived discussion
threads, it doesn't really matter. Issue attachments are supported
by GitHub, so we should support them too.
Sadly, I think you're right: there are no APIs around attachments — whether
release, issue, pull request, or discussion — to make something like this easy.
Without them, the best anyone could do is pulling the main issue body and every
issue comment looking for specific GitHub domains like *.githubassets.com,
*.githubusercontent.com. This sounds like a great idea for someone wanting to
hack on a GitHub CLI extension.
I believe it is primarily not possible, with or without any
extension. As far as I know, you can't access a file from an issue,
even with a direct URL to it. (only through a browser, or simulating
a brwoser, using its cookies).
Maybe I am wrong, but I am 99.9% sure that it is not possible, and
the client can't do anything about it.
…--
Igor Chubin
|
Describe the feature or problem you’d like to solve
I know that it is not possible to upload files to issues programmatically, but it would be helpful to at least be able to download files. At the moment, as far as I understand, it is not possible either.
This would allow users to automatically process issues with attachments in their bodies and comments.
Proposed solution
Add a new command that will download a file referred to in the issue by its URL
The text was updated successfully, but these errors were encountered: