Skip to content

Security advisory changes break --all --private #481

@indirect

Description

@indirect

What happened?

I have used github-backup for quite some time. Sometime in the last few weeks, my regular job started failing, without me making any changes to the arguments except upgrading to the latest version.

In my testing, any combination of --all with --private now fails with the below backtrace, which previously worked.

❯ uvx github-backup@latest indirect --output-directory /Users/Shared/GitHub/indirect --keychain-account indirect --keychain-name github-backup-indirect --incremental --all --private
Installed 1 package in 2ms
2026-01-20T20:09:46.404: Backing up user indirect to /Users/Shared/GitHub/indirect
2026-01-20T20:09:46.419: Requesting https://api.github.com/user
2026-01-20T20:09:46.659: Retrieving repositories
2026-01-20T20:09:46.687: Requesting https://api.github.com/user/repos?per_page=100
2026-01-20T20:09:47.760: Requesting https://api.github.com/user/repos?per_page=100&page=2
2026-01-20T20:09:48.979: Requesting https://api.github.com/user/repos?per_page=100&page=3
2026-01-20T20:09:49.903: Requesting https://api.github.com/user/repos?per_page=100&page=4
2026-01-20T20:09:50.576: Filtering repositories
2026-01-20T20:09:50.577: Backing up repositories
2026-01-20T20:09:50.961: Updating .github in /Users/Shared/GitHub/indirect/repositories/.github/repository
2026-01-20T20:09:51.332: Retrieving indirect/.github issues
2026-01-20T20:09:51.350: Requesting https://api.github.com/repos/indirect/.github/issues?per_page=100&filter=all&state=open&since=2026-01-20T13%3A59%3A01Z
2026-01-20T20:09:51.795: Requesting https://api.github.com/repos/indirect/.github/issues?per_page=100&filter=all&state=closed&since=2026-01-20T13%3A59%3A01Z
2026-01-20T20:09:52.080: Saving 0 issues to disk
2026-01-20T20:09:52.081: Retrieving indirect/.github pull requests
2026-01-20T20:09:52.102: Requesting https://api.github.com/repos/indirect/.github/pulls?per_page=100&filter=all&state=open&sort=updated&direction=desc
2026-01-20T20:09:52.391: Requesting https://api.github.com/repos/indirect/.github/pulls?per_page=100&filter=all&state=closed&sort=updated&direction=desc
2026-01-20T20:09:52.655: Saving 0 pull requests to disk
2026-01-20T20:09:52.655: Retrieving indirect/.github milestones
2026-01-20T20:09:52.685: Requesting https://api.github.com/repos/indirect/.github/milestones?per_page=100&state=all
2026-01-20T20:09:52.949: Saved 0 milestones to disk
Traceback (most recent call last):
  File "/Users/andre/.cache/uv/archive-v0/T2HChUH0BqALspF3t_7XZ/bin/github-backup", line 12, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/andre/.cache/uv/archive-v0/T2HChUH0BqALspF3t_7XZ/lib/python3.13/site-packages/github_backup/cli.py", line 83, in main
    backup_repositories(args, output_directory, repositories)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andre/.cache/uv/archive-v0/T2HChUH0BqALspF3t_7XZ/lib/python3.13/site-packages/github_backup/github_backup.py", line 1817, in backup_repositories
    if args.include_security_advisories or (args.include_everything and not repository["Private"]):
                                                                            ~~~~~~~~~~^^^^^^^^^^^
KeyError: 'Private'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions