github-backup 0.66.0__py3-none-any.whl → 0.66.1__py3-none-any.whl

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/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.66.0"
1
+ __version__ = "0.66.1"
@@ -3155,6 +3155,15 @@ def backup_hooks(args, repo_cwd, repository, repos_template):
3155
3155
  if not auth:
3156
3156
  logger.info("Skipping hooks since no authentication provided")
3157
3157
  return
3158
+ # Reading hooks needs admin access, and GitHub returns 404 without it.
3159
+ # Skip the request when the repository listing says we aren't an admin.
3160
+ if repository.get("permissions", {}).get("admin") is False:
3161
+ logger.info(
3162
+ "Skipping hooks for {0} since admin access is required".format(
3163
+ repository["full_name"]
3164
+ )
3165
+ )
3166
+ return
3158
3167
  hook_cwd = os.path.join(repo_cwd, "hooks")
3159
3168
  output_file = "{0}/hooks.json".format(hook_cwd)
3160
3169
  template = "{0}/{1}/hooks".format(repos_template, repository["full_name"])
@@ -3162,7 +3171,12 @@ def backup_hooks(args, repo_cwd, repository, repos_template):
3162
3171
  _backup_data(args, "hooks", template, output_file, hook_cwd)
3163
3172
  except HTTPError as e:
3164
3173
  if e.code == 404:
3165
- logger.info("Unable to read hooks, skipping")
3174
+ logger.info(
3175
+ "Unable to read hooks for {0}, skipping (requires admin access, "
3176
+ "or Webhooks read permission for fine-grained tokens)".format(
3177
+ repository["full_name"]
3178
+ )
3179
+ )
3166
3180
  else:
3167
3181
  raise e
3168
3182
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-backup
3
- Version: 0.66.0
3
+ Version: 0.66.1
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
@@ -437,11 +437,9 @@ If the incremental argument is used, per-resource checkpoints are only advanced
437
437
 
438
438
  It's therefore recommended to only use the incremental argument if the output/result is being actively monitored, or complimented with periodic full non-incremental runs, to avoid unexpected missing data in a regular backup runs.
439
439
 
440
- **Starred public repo hooks blocking**
440
+ **Hooks need admin access**
441
441
 
442
- Since the ``--all`` argument includes ``--hooks``, if you use ``--all`` and ``--all-starred`` together to clone a users starred public repositories, the backup will likely error and block the backup continuing.
443
-
444
- This is due to needing the correct permission for ``--hooks`` on public repos.
442
+ Reading a repository's hooks requires admin access to it, and fine-grained tokens also need the Webhooks read permission. Since the ``--all`` argument includes ``--hooks``, repositories you don't administer, such as starred repositories with ``--all-starred``, are skipped for hooks and the rest of the backup continues.
445
443
 
446
444
 
447
445
  "bare" is actually "mirror"
@@ -0,0 +1,12 @@
1
+ github_backup/__init__.py,sha256=Y_9EKLxx08OQDNPkUFPkOvW0swweoBoNGuSmF8BmY9s,23
2
+ github_backup/__main__.py,sha256=3yorCiC63maaxbjdtaeAs-G-yAAxKSO3mprhGfa1Fho,271
3
+ github_backup/cli.py,sha256=JTiXPOvB8id8LopREOEd1W_FLvuf9SOZU5buMRPFd9U,2922
4
+ github_backup/github_backup.py,sha256=m-pN6QDINtl4-ElNBjkuWOhydwgLITRxkRfZeAIQmvE,127713
5
+ github_backup/graphql_queries.py,sha256=XcAQyp9nF7Ip9UzxsrXMkl2pO-W7SK8hhO2oE9HVcmA,6658
6
+ github_backup-0.66.1.dist-info/licenses/LICENSE.txt,sha256=ML-pLyn1qtAKo_DHMcQ8-p7k3f8cp-IR-mf5B49R2rk,1085
7
+ github_backup-0.66.1.dist-info/METADATA,sha256=bTU1Yw07sSyiygsiFas4iI4ppAmMI3EKMGzq3ZSD2OU,36215
8
+ github_backup-0.66.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
9
+ github_backup-0.66.1.dist-info/entry_points.txt,sha256=cLPKK7MqC77QVb6HnT2mnyL_f-ciavJG_Y9vVHlCF68,57
10
+ github_backup-0.66.1.dist-info/top_level.txt,sha256=Za6fKRAlxZ0b3ZBH_osPqklLe14LetdNAkvAQANT2AA,14
11
+ github_backup-0.66.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
+ github_backup-0.66.1.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- github_backup/__init__.py,sha256=rdBd9Kj9DDCtQNzVZEbaE1YatB7HZXL9qX4Ge-gXzaM,23
2
- github_backup/__main__.py,sha256=3yorCiC63maaxbjdtaeAs-G-yAAxKSO3mprhGfa1Fho,271
3
- github_backup/cli.py,sha256=JTiXPOvB8id8LopREOEd1W_FLvuf9SOZU5buMRPFd9U,2922
4
- github_backup/github_backup.py,sha256=zvWTp4_02ep-O7lE0fNuIBdMpN7wHKanboC4hydLXhA,127118
5
- github_backup/graphql_queries.py,sha256=XcAQyp9nF7Ip9UzxsrXMkl2pO-W7SK8hhO2oE9HVcmA,6658
6
- github_backup-0.66.0.dist-info/licenses/LICENSE.txt,sha256=ML-pLyn1qtAKo_DHMcQ8-p7k3f8cp-IR-mf5B49R2rk,1085
7
- github_backup-0.66.0.dist-info/METADATA,sha256=x9vCzseh_H9lmtHA3Wb1O0iS1rlvAfrONsLMuco26eM,36196
8
- github_backup-0.66.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
9
- github_backup-0.66.0.dist-info/entry_points.txt,sha256=cLPKK7MqC77QVb6HnT2mnyL_f-ciavJG_Y9vVHlCF68,57
10
- github_backup-0.66.0.dist-info/top_level.txt,sha256=Za6fKRAlxZ0b3ZBH_osPqklLe14LetdNAkvAQANT2AA,14
11
- github_backup-0.66.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
- github_backup-0.66.0.dist-info/RECORD,,