Unverified Commit 21d41886 authored by Austin Horstman's avatar Austin Horstman
Browse files

nixpkgs-plugin-update: no token fallback



GraphQL endpoint introduced in previous tagging work requires a
GITHUB_TOKEN. Fallback to `git ls-remote` when we don't have a token to
work with.

Signed-off-by: default avatarAustin Horstman <khaneliman12@gmail.com>
parent 3fc35972
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -288,6 +288,14 @@ class RepoGitHub(Repo):
    @retry(urllib.error.URLError, tries=4, delay=3, backoff=2)
    def get_latest_tag(self) -> str | None:
        try:
            if not self.token or self.token == "":
                log.info(
                    "No GitHub token available for %s/%s, using git ls-remote fallback",
                    self.owner,
                    self.repo,
                )
                return super().get_latest_tag()

            # FIXME: This fetches all tags. We need to find a way to check if a tag exists in
            # an ancestor of the default branch.
            query = """