drdhaval2785 / github_issue_backup

a script to backup github issues
0 stars 0 forks source link

Download the attachment files in the private repo issues #37

Closed sroamer closed 8 years ago

sroamer commented 8 years ago

It's a great tool to backup Github issues. Just see if that's possible to download the attachment files in the private repository issues? The image download function is really useful, that's great if we can download the attachment files.

The images are saved in https://cloud.githubusercontent.com/assets, but attachments are saved https://github.com/organization/repository/files.

Do you have any ideas to get the attachment files from issues? and consider adding this function in your source code? Thanks.

drdhaval2785 commented 8 years ago

@sroamer The days when the code was written, github didn't allow document uploads in issues. Now it is time to move in that direction. Thank you very much for drawing my attention to it. Will do ASAP.

drdhaval2785 commented 8 years ago

test.txt

Trying to have this text retrieved.

drdhaval2785 commented 8 years ago

test2.txt

Another test file

Small PDF for test too Devanagari-Scheme.pdf

drdhaval2785 commented 8 years ago

@sroamer

https://github.com/drdhaval2785/github_issue_backup/releases/tag/v1.1.3 This release would download the files too.

Test on a few issues and let me know about bugs.

Known issue - When there are two files with the same name in one issue, this code may not function well. But don't guess that this is a substantial issue.

gasyoun commented 8 years ago

Well done.

sroamer commented 8 years ago

@drdhaval2785 Thanks for your great jobs. A challenging problem is for the private repo in github, looks like curl or wget cannot fetch the files with regular authentication (basic auth token or OAuth didn't work). Do you have any ideas about this?

drdhaval2785 commented 8 years ago

@sroamer I have no idea about private repos. Right now the code uses the token and OAuth which I created for myself.

Maybe replacing the client_id and password in https://github.com/drdhaval2785/github_issue_backup/blob/master/github_issue_backup.sh#L56 and https://github.com/drdhaval2785/github_issue_backup/blob/master/github_issue_backup.sh#L84 with the client_id and password for your own can resolve the issue.

https://developer.github.com/v3/issues/ Documentation uses the term across all visible repositories. Therefore, I guess using my token and password won't allow you to peek inside private repositories. But your own private repository is visible to you. So your token and password would serve the purpose AFAIK.