You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add attachment download support for issues and pull requests
Adds new --attachments flag that downloads user-uploaded files from
issue and PR bodies and comments. Key features:
- Determines attachment URLs
- Tracks downloads in manifest.json with metadata
- Supports --skip-existing to avoid re-downloading
- Handles filename collisions with counter suffix
- Smart retry logic for transient vs permanent failures
- Uses Content-Disposition for correct file extensions
--skip-prerelease skip prerelease and draft versions; only applies if including releases
134
134
--assets include assets alongside release information; only
135
135
applies if including releases
136
+
--attachments download user-attachments from issues and pull requests
137
+
to issues/attachments/{issue_number}/ and
138
+
pulls/attachments/{pull_number}/ directories
136
139
--exclude [REPOSITORY [REPOSITORY ...]]
137
140
names of repositories to exclude from backup.
138
141
--throttle-limit THROTTLE_LIMIT
@@ -213,6 +216,29 @@ When you use the ``--lfs`` option, you will need to make sure you have Git LFS i
213
216
Instructions on how to do this can be found on https://git-lfs.github.com.
214
217
215
218
219
+
About Attachments
220
+
-----------------
221
+
222
+
When you use the ``--attachments`` option with ``--issues`` or ``--pulls``, the tool will download user-uploaded attachments (images, videos, documents, etc.) from issue and pull request descriptions and comments. In some circumstances attachments contain valuable data related to the topic, and without their backup important information or context might be lost inadvertently.
223
+
224
+
Attachments are saved to ``issues/attachments/{issue_number}/`` and ``pulls/attachments/{pull_number}/`` directories, where ``{issue_number}`` is the GitHub issue number (e.g., issue #123 saves to ``issues/attachments/123/``). Each attachment directory contains:
225
+
226
+
- The downloaded attachment files (named by their GitHub identifier with appropriate file extensions)
227
+
- If multiple attachments have the same filename, conflicts are resolved with numeric suffixes (e.g., ``report.pdf``, ``report_1.pdf``, ``report_2.pdf``)
228
+
- A ``manifest.json`` file documenting all downloads, including URLs, file metadata, and download status
229
+
230
+
The tool automatically extracts file extensions from HTTP headers to ensure files can be more easily opened by your operating system.
- Legacy: ``user-images.githubusercontent.com/*`` and ``private-user-images.githubusercontent.com/*``
236
+
- Repo files: ``github.com/{owner}/{repo}/files/*`` (filtered to current repository)
237
+
- Repo assets: ``github.com/{owner}/{repo}/assets/*`` (filtered to current repository)
238
+
239
+
**Repository filtering** for repo files/assets handles renamed and transferred repositories gracefully. URLs are included if they either match the current repository name directly, or redirect to it (e.g., ``willmcgugan/rich`` redirects to ``Textualize/rich`` after transfer).
240
+
241
+
216
242
Run in Docker container
217
243
-----------------------
218
244
@@ -303,7 +329,7 @@ Quietly and incrementally backup useful Github user data (public and private rep
0 commit comments