repomatic.github.sponsor module¶
Check if a GitHub user is a sponsor of another user or organization.
Uses the GitHub GraphQL API via the gh CLI to query sponsorship data, with
pagination for accounts that have more than 100 sponsors.
- repomatic.github.sponsor.SPONSORS_QUERY = '\nquery($owner: String!, $cursor: String) {\n repositoryOwner(login: $owner) {\n ... on Sponsorable {\n sponsorshipsAsMaintainer(first: 100, after: $cursor, includePrivate: true) {\n pageInfo { hasNextPage endCursor }\n nodes { sponsorEntity { ... on User { login } ... on Organization { login } } }\n }\n }\n }\n}\n'¶
GraphQL query for an account’s sponsors, a user or an organization alike.
repositoryOwnerresolves both kinds of account, and both implement theSponsorableinterface, so one query covers either without a probe for the kind first.
- repomatic.github.sponsor.iter_sponsors(owner)[source]¶
Iterate over every sponsor of owner, following pagination.
- Parameters:
owner (
str) – The user or organization to query.- Yields:
str– Login names of sponsors.- Raises:
GhCommandError – When a
ghinvocation fails.