Skip to content

Empty repositories crash github-backup #489

@tisecinfo

Description

@tisecinfo

What happened?

Steps to reproduce:

github-backup -t github_pat_123 pski

Result:

2026-02-18T09:38:25.724: Backing up user pski to /tmp
2026-02-18T09:38:25.725: Requesting https://api.github.com/user
2026-02-18T09:38:25.966: Retrieving repositories
2026-02-18T09:38:25.966: Requesting https://api.github.com/users/pski/repos?per_page=100
2026-02-18T09:38:26.315: Filtering repositories
2026-02-18T09:38:26.315: Backing up repositories
2026-02-18T09:38:26.315: '>' not supported between instances of 'NoneType' and 'str'

The repository causing this bug is pski/Testproject which is empty.

Note that this bug will not be triggered if you directly backup the repository via github-backup -t github_pat_123 -R Testproject pski.

In line 1760 github-backup retrieves the lists of repositories for a user. In line 1777 github-backup checks the following:

elif "pushed_at" in repository and repository["pushed_at"] > last_update:

For empty repositories repository["pushed_at"] is present however it is None, so the comparison causes an Exception.

I'm sorry that I don't provide a Pull Request, I don't have the means to do that right now.

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