Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ jobs:
- 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 }}
7 changes: 4 additions & 3 deletions scripts/sponsors.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class SponsorsResponse(BaseModel):


class Settings(BaseSettings):
github_token: SecretStr
sponsors_token: SecretStr
pr_token: SecretStr
github_repository: str
httpx_timeout: int = 30

Expand All @@ -94,7 +95,7 @@ def get_graphql_response(
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,
Expand Down Expand Up @@ -159,7 +160,7 @@ def main() -> None:
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)
Expand Down