github-backup 0.56.0__tar.gz → 0.58.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {github_backup-0.56.0 → github_backup-0.58.0}/CHANGES.rst +61 -1
- {github_backup-0.56.0/github_backup.egg-info → github_backup-0.58.0}/PKG-INFO +40 -3
- {github_backup-0.56.0 → github_backup-0.58.0}/README +39 -2
- {github_backup-0.56.0 → github_backup-0.58.0}/README.rst +39 -2
- github_backup-0.58.0/github_backup/__init__.py +1 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup/github_backup.py +237 -233
- {github_backup-0.56.0 → github_backup-0.58.0/github_backup.egg-info}/PKG-INFO +40 -3
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup.egg-info/SOURCES.txt +3 -1
- github_backup-0.58.0/release-requirements.txt +15 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/tests/test_http_451.py +6 -49
- {github_backup-0.56.0 → github_backup-0.58.0}/tests/test_pagination.py +7 -13
- github_backup-0.58.0/tests/test_retrieve_data.py +365 -0
- github_backup-0.58.0/tests/test_skip_assets_on.py +320 -0
- github_backup-0.56.0/github_backup/__init__.py +0 -1
- github_backup-0.56.0/release-requirements.txt +0 -40
- {github_backup-0.56.0 → github_backup-0.58.0}/LICENSE.txt +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/MANIFEST.in +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup/__main__.py +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup/cli.py +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup.egg-info/dependency_links.txt +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup.egg-info/entry_points.txt +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup.egg-info/top_level.txt +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/github_backup.egg-info/zip-safe +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/requirements.txt +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/setup.cfg +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/setup.py +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/tests/test_all_starred.py +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/tests/test_attachments.py +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/tests/test_case_sensitivity.py +0 -0
- {github_backup-0.56.0 → github_backup-0.58.0}/tests/test_json_dump_if_changed.py +0 -0
|
@@ -1,9 +1,69 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
-
0.
|
|
4
|
+
0.58.0 (2025-12-16)
|
|
5
5
|
-------------------
|
|
6
6
|
------------------------
|
|
7
|
+
- Fix retry logic for HTTP 5xx errors and network failures. [Rodos]
|
|
8
|
+
|
|
9
|
+
Refactors error handling to retry all 5xx errors (not just 502), network errors (URLError, socket.error, IncompleteRead), and JSON parse errors with exponential backoff and jitter. Respects retry-after and rate limit headers per GitHub API requirements. Consolidates retry logic into make_request_with_retry() wrapper and adds clear logging for retry attempts and failures. Removes dead code from 2016 (errors list, _request_http_error, _request_url_error) that was intentionally disabled in commit 1e5a9048 to fix #29.
|
|
10
|
+
|
|
11
|
+
Fixes #140, #110, #138
|
|
12
|
+
- Chore: remove transitive deps from release-requirements.txt. [Rodos]
|
|
13
|
+
- Chore(deps): bump urllib3 in the python-packages group.
|
|
14
|
+
[dependabot[bot]]
|
|
15
|
+
|
|
16
|
+
Bumps the python-packages group with 1 update: [urllib3](https://github.com/urllib3/urllib3).
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Updates `urllib3` from 2.6.1 to 2.6.2
|
|
20
|
+
- [Release notes](https://github.com/urllib3/urllib3/releases)
|
|
21
|
+
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
|
|
22
|
+
- [Commits](https://github.com/urllib3/urllib3/compare/2.6.1...2.6.2)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
updated-dependencies:
|
|
26
|
+
- dependency-name: urllib3
|
|
27
|
+
dependency-version: 2.6.2
|
|
28
|
+
dependency-type: direct:production
|
|
29
|
+
update-type: version-update:semver-patch
|
|
30
|
+
dependency-group: python-packages
|
|
31
|
+
...
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
0.57.0 (2025-12-12)
|
|
35
|
+
-------------------
|
|
36
|
+
- Add GitHub Apps documentation and remove outdated header. [Rodos]
|
|
37
|
+
|
|
38
|
+
- Add GitHub Apps authentication section with setup steps
|
|
39
|
+
and CI/CD workflow example using actions/create-github-app-token
|
|
40
|
+
- Remove outdated machine-man-preview header (graduated 2020)
|
|
41
|
+
|
|
42
|
+
Closes #189
|
|
43
|
+
- Docs: add stdin token example to README. [Rodos]
|
|
44
|
+
|
|
45
|
+
Add example showing how to pipe a token from stdin using
|
|
46
|
+
file:///dev/stdin to avoid storing tokens in environment
|
|
47
|
+
variables or command history.
|
|
48
|
+
|
|
49
|
+
Closes #187
|
|
50
|
+
- Add --skip-assets-on flag to skip release asset downloads (#135)
|
|
51
|
+
[Rodos]
|
|
52
|
+
|
|
53
|
+
Allow users to skip downloading release assets for specific repositories
|
|
54
|
+
while still backing up release metadata. Useful for starred repos with
|
|
55
|
+
large assets (e.g. syncthing with 27GB+).
|
|
56
|
+
|
|
57
|
+
Usage: --skip-assets-on repo1 repo2 owner/repo3
|
|
58
|
+
|
|
59
|
+
Features:
|
|
60
|
+
- Space-separated repos (consistent with --exclude)
|
|
61
|
+
- Case-insensitive matching
|
|
62
|
+
- Supports both repo name and owner/repo format
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
0.56.0 (2025-12-11)
|
|
66
|
+
-------------------
|
|
7
67
|
|
|
8
68
|
Fix
|
|
9
69
|
~~~
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: github-backup
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.58.0
|
|
4
4
|
Summary: backup a github user or organization
|
|
5
5
|
Home-page: http://github.com/josegonzalez/python-github-backup
|
|
6
6
|
Author: Jose Diaz-Gonzalez
|
|
@@ -80,8 +80,8 @@ CLI Help output::
|
|
|
80
80
|
[--keychain-name OSX_KEYCHAIN_ITEM_NAME]
|
|
81
81
|
[--keychain-account OSX_KEYCHAIN_ITEM_ACCOUNT]
|
|
82
82
|
[--releases] [--latest-releases NUMBER_OF_LATEST_RELEASES]
|
|
83
|
-
[--skip-prerelease] [--assets] [--
|
|
84
|
-
[--exclude [REPOSITORY [REPOSITORY ...]]
|
|
83
|
+
[--skip-prerelease] [--assets] [--skip-assets-on [REPO ...]]
|
|
84
|
+
[--attachments] [--exclude [REPOSITORY [REPOSITORY ...]]
|
|
85
85
|
[--throttle-limit THROTTLE_LIMIT] [--throttle-pause THROTTLE_PAUSE]
|
|
86
86
|
USER
|
|
87
87
|
|
|
@@ -163,6 +163,9 @@ CLI Help output::
|
|
|
163
163
|
--skip-prerelease skip prerelease and draft versions; only applies if including releases
|
|
164
164
|
--assets include assets alongside release information; only
|
|
165
165
|
applies if including releases
|
|
166
|
+
--skip-assets-on [REPO ...]
|
|
167
|
+
skip asset downloads for these repositories (e.g.
|
|
168
|
+
--skip-assets-on repo1 owner/repo2)
|
|
166
169
|
--attachments download user-attachments from issues and pull requests
|
|
167
170
|
to issues/attachments/{issue_number}/ and
|
|
168
171
|
pulls/attachments/{pull_number}/ directories
|
|
@@ -204,6 +207,37 @@ Customise the permissions for your use case, but for a personal account full bac
|
|
|
204
207
|
**Repository permissions**: Read access to contents, issues, metadata, pull requests, and webhooks.
|
|
205
208
|
|
|
206
209
|
|
|
210
|
+
GitHub Apps
|
|
211
|
+
~~~~~~~~~~~
|
|
212
|
+
|
|
213
|
+
GitHub Apps are ideal for organization backups in CI/CD. Tokens are scoped to specific repositories and expire after 1 hour.
|
|
214
|
+
|
|
215
|
+
**One-time setup:**
|
|
216
|
+
|
|
217
|
+
1. Create a GitHub App at *Settings -> Developer Settings -> GitHub Apps -> New GitHub App*
|
|
218
|
+
2. Set a name and homepage URL (can be any URL)
|
|
219
|
+
3. Uncheck "Webhook > Active" (not needed for backups)
|
|
220
|
+
4. Set permissions (same as fine-grained tokens above)
|
|
221
|
+
5. Click "Create GitHub App", then note the **App ID** shown on the next page
|
|
222
|
+
6. Under "Private keys", click "Generate a private key" and save the downloaded file
|
|
223
|
+
7. Go to *Install App* in your app's settings
|
|
224
|
+
8. Select the account/organization and which repositories to back up
|
|
225
|
+
|
|
226
|
+
**CI/CD usage with GitHub Actions:**
|
|
227
|
+
|
|
228
|
+
Store the App ID as a repository variable and the private key contents as a secret, then use ``actions/create-github-app-token``::
|
|
229
|
+
|
|
230
|
+
- uses: actions/create-github-app-token@v1
|
|
231
|
+
id: app-token
|
|
232
|
+
with:
|
|
233
|
+
app-id: ${{ vars.APP_ID }}
|
|
234
|
+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
235
|
+
|
|
236
|
+
- run: github-backup myorg -t ${{ steps.app-token.outputs.token }} --as-app -o ./backup --all
|
|
237
|
+
|
|
238
|
+
Note: Installation tokens expire after 1 hour. For long-running backups, use a fine-grained personal access token instead.
|
|
239
|
+
|
|
240
|
+
|
|
207
241
|
Prefer SSH
|
|
208
242
|
~~~~~~~~~~
|
|
209
243
|
|
|
@@ -391,6 +425,9 @@ Debug an error/block or incomplete backup into a temporary directory. Omit "incr
|
|
|
391
425
|
|
|
392
426
|
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-commits --labels --milestones --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
393
427
|
|
|
428
|
+
Pipe a token from stdin to avoid storing it in environment variables or command history (Unix-like systems only)::
|
|
429
|
+
|
|
430
|
+
my-secret-manager get github-token | github-backup user -t file:///dev/stdin -o /backup --repositories
|
|
394
431
|
|
|
395
432
|
Restoring from Backup
|
|
396
433
|
=====================
|
|
@@ -50,8 +50,8 @@ CLI Help output::
|
|
|
50
50
|
[--keychain-name OSX_KEYCHAIN_ITEM_NAME]
|
|
51
51
|
[--keychain-account OSX_KEYCHAIN_ITEM_ACCOUNT]
|
|
52
52
|
[--releases] [--latest-releases NUMBER_OF_LATEST_RELEASES]
|
|
53
|
-
[--skip-prerelease] [--assets] [--
|
|
54
|
-
[--exclude [REPOSITORY [REPOSITORY ...]]
|
|
53
|
+
[--skip-prerelease] [--assets] [--skip-assets-on [REPO ...]]
|
|
54
|
+
[--attachments] [--exclude [REPOSITORY [REPOSITORY ...]]
|
|
55
55
|
[--throttle-limit THROTTLE_LIMIT] [--throttle-pause THROTTLE_PAUSE]
|
|
56
56
|
USER
|
|
57
57
|
|
|
@@ -133,6 +133,9 @@ CLI Help output::
|
|
|
133
133
|
--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
|
+
--skip-assets-on [REPO ...]
|
|
137
|
+
skip asset downloads for these repositories (e.g.
|
|
138
|
+
--skip-assets-on repo1 owner/repo2)
|
|
136
139
|
--attachments download user-attachments from issues and pull requests
|
|
137
140
|
to issues/attachments/{issue_number}/ and
|
|
138
141
|
pulls/attachments/{pull_number}/ directories
|
|
@@ -174,6 +177,37 @@ Customise the permissions for your use case, but for a personal account full bac
|
|
|
174
177
|
**Repository permissions**: Read access to contents, issues, metadata, pull requests, and webhooks.
|
|
175
178
|
|
|
176
179
|
|
|
180
|
+
GitHub Apps
|
|
181
|
+
~~~~~~~~~~~
|
|
182
|
+
|
|
183
|
+
GitHub Apps are ideal for organization backups in CI/CD. Tokens are scoped to specific repositories and expire after 1 hour.
|
|
184
|
+
|
|
185
|
+
**One-time setup:**
|
|
186
|
+
|
|
187
|
+
1. Create a GitHub App at *Settings -> Developer Settings -> GitHub Apps -> New GitHub App*
|
|
188
|
+
2. Set a name and homepage URL (can be any URL)
|
|
189
|
+
3. Uncheck "Webhook > Active" (not needed for backups)
|
|
190
|
+
4. Set permissions (same as fine-grained tokens above)
|
|
191
|
+
5. Click "Create GitHub App", then note the **App ID** shown on the next page
|
|
192
|
+
6. Under "Private keys", click "Generate a private key" and save the downloaded file
|
|
193
|
+
7. Go to *Install App* in your app's settings
|
|
194
|
+
8. Select the account/organization and which repositories to back up
|
|
195
|
+
|
|
196
|
+
**CI/CD usage with GitHub Actions:**
|
|
197
|
+
|
|
198
|
+
Store the App ID as a repository variable and the private key contents as a secret, then use ``actions/create-github-app-token``::
|
|
199
|
+
|
|
200
|
+
- uses: actions/create-github-app-token@v1
|
|
201
|
+
id: app-token
|
|
202
|
+
with:
|
|
203
|
+
app-id: ${{ vars.APP_ID }}
|
|
204
|
+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
205
|
+
|
|
206
|
+
- run: github-backup myorg -t ${{ steps.app-token.outputs.token }} --as-app -o ./backup --all
|
|
207
|
+
|
|
208
|
+
Note: Installation tokens expire after 1 hour. For long-running backups, use a fine-grained personal access token instead.
|
|
209
|
+
|
|
210
|
+
|
|
177
211
|
Prefer SSH
|
|
178
212
|
~~~~~~~~~~
|
|
179
213
|
|
|
@@ -361,6 +395,9 @@ Debug an error/block or incomplete backup into a temporary directory. Omit "incr
|
|
|
361
395
|
|
|
362
396
|
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-commits --labels --milestones --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
363
397
|
|
|
398
|
+
Pipe a token from stdin to avoid storing it in environment variables or command history (Unix-like systems only)::
|
|
399
|
+
|
|
400
|
+
my-secret-manager get github-token | github-backup user -t file:///dev/stdin -o /backup --repositories
|
|
364
401
|
|
|
365
402
|
Restoring from Backup
|
|
366
403
|
=====================
|
|
@@ -50,8 +50,8 @@ CLI Help output::
|
|
|
50
50
|
[--keychain-name OSX_KEYCHAIN_ITEM_NAME]
|
|
51
51
|
[--keychain-account OSX_KEYCHAIN_ITEM_ACCOUNT]
|
|
52
52
|
[--releases] [--latest-releases NUMBER_OF_LATEST_RELEASES]
|
|
53
|
-
[--skip-prerelease] [--assets] [--
|
|
54
|
-
[--exclude [REPOSITORY [REPOSITORY ...]]
|
|
53
|
+
[--skip-prerelease] [--assets] [--skip-assets-on [REPO ...]]
|
|
54
|
+
[--attachments] [--exclude [REPOSITORY [REPOSITORY ...]]
|
|
55
55
|
[--throttle-limit THROTTLE_LIMIT] [--throttle-pause THROTTLE_PAUSE]
|
|
56
56
|
USER
|
|
57
57
|
|
|
@@ -133,6 +133,9 @@ CLI Help output::
|
|
|
133
133
|
--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
|
+
--skip-assets-on [REPO ...]
|
|
137
|
+
skip asset downloads for these repositories (e.g.
|
|
138
|
+
--skip-assets-on repo1 owner/repo2)
|
|
136
139
|
--attachments download user-attachments from issues and pull requests
|
|
137
140
|
to issues/attachments/{issue_number}/ and
|
|
138
141
|
pulls/attachments/{pull_number}/ directories
|
|
@@ -174,6 +177,37 @@ Customise the permissions for your use case, but for a personal account full bac
|
|
|
174
177
|
**Repository permissions**: Read access to contents, issues, metadata, pull requests, and webhooks.
|
|
175
178
|
|
|
176
179
|
|
|
180
|
+
GitHub Apps
|
|
181
|
+
~~~~~~~~~~~
|
|
182
|
+
|
|
183
|
+
GitHub Apps are ideal for organization backups in CI/CD. Tokens are scoped to specific repositories and expire after 1 hour.
|
|
184
|
+
|
|
185
|
+
**One-time setup:**
|
|
186
|
+
|
|
187
|
+
1. Create a GitHub App at *Settings -> Developer Settings -> GitHub Apps -> New GitHub App*
|
|
188
|
+
2. Set a name and homepage URL (can be any URL)
|
|
189
|
+
3. Uncheck "Webhook > Active" (not needed for backups)
|
|
190
|
+
4. Set permissions (same as fine-grained tokens above)
|
|
191
|
+
5. Click "Create GitHub App", then note the **App ID** shown on the next page
|
|
192
|
+
6. Under "Private keys", click "Generate a private key" and save the downloaded file
|
|
193
|
+
7. Go to *Install App* in your app's settings
|
|
194
|
+
8. Select the account/organization and which repositories to back up
|
|
195
|
+
|
|
196
|
+
**CI/CD usage with GitHub Actions:**
|
|
197
|
+
|
|
198
|
+
Store the App ID as a repository variable and the private key contents as a secret, then use ``actions/create-github-app-token``::
|
|
199
|
+
|
|
200
|
+
- uses: actions/create-github-app-token@v1
|
|
201
|
+
id: app-token
|
|
202
|
+
with:
|
|
203
|
+
app-id: ${{ vars.APP_ID }}
|
|
204
|
+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
205
|
+
|
|
206
|
+
- run: github-backup myorg -t ${{ steps.app-token.outputs.token }} --as-app -o ./backup --all
|
|
207
|
+
|
|
208
|
+
Note: Installation tokens expire after 1 hour. For long-running backups, use a fine-grained personal access token instead.
|
|
209
|
+
|
|
210
|
+
|
|
177
211
|
Prefer SSH
|
|
178
212
|
~~~~~~~~~~
|
|
179
213
|
|
|
@@ -361,6 +395,9 @@ Debug an error/block or incomplete backup into a temporary directory. Omit "incr
|
|
|
361
395
|
|
|
362
396
|
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-commits --labels --milestones --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
363
397
|
|
|
398
|
+
Pipe a token from stdin to avoid storing it in environment variables or command history (Unix-like systems only)::
|
|
399
|
+
|
|
400
|
+
my-secret-manager get github-token | github-backup user -t file:///dev/stdin -o /backup --repositories
|
|
364
401
|
|
|
365
402
|
Restoring from Backup
|
|
366
403
|
=====================
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.58.0"
|