- name: FastAPI People Sponsors
run: python ./scripts/sponsors.py
env:
- GITHUB_TOKEN: ${{ secrets.SPONSORS }}
+ SPONSORS_TOKEN: ${{ secrets.SPONSORS_TOKEN }}
+ PR_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }}
class Settings(BaseSettings):
- github_token: SecretStr
+ sponsors_token: SecretStr
+ pr_token: SecretStr
github_repository: str
httpx_timeout: int = 30
query: str,
after: str | None = None,
) -> dict[str, Any]:
- headers = {"Authorization": f"token {settings.github_token.get_secret_value()}"}
+ headers = {"Authorization": f"token {settings.sponsors_token.get_secret_value()}"}
variables = {"after": after}
response = httpx.post(
github_graphql_url,
logging.basicConfig(level=logging.INFO)
settings = Settings()
logging.info(f"Using config: {settings.model_dump_json()}")
- g = Github(settings.github_token.get_secret_value())
+ g = Github(settings.pr_token.get_secret_value())
repo = g.get_repo(settings.github_repository)
tiers = get_individual_sponsors(settings=settings)