mirror of https://github.com/tiangolo/fastapi.git
♻️ Update config to github_token
This commit is contained in:
parent
343d0e6221
commit
1a29cb841d
|
|
@ -112,7 +112,7 @@ class PRsResponse(BaseModel):
|
|||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
token: SecretStr
|
||||
github_token: SecretStr
|
||||
github_repository: str
|
||||
httpx_timeout: int = 30
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ def get_graphql_response(
|
|||
query: str,
|
||||
after: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
headers = {"Authorization": f"token {settings.token.get_secret_value()}"}
|
||||
headers = {"Authorization": f"token {settings.github_token.get_secret_value()}"}
|
||||
variables = {"after": after}
|
||||
response = httpx.post(
|
||||
github_graphql_url,
|
||||
|
|
@ -238,7 +238,7 @@ def main() -> None:
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
settings = Settings()
|
||||
logging.info(f"Using config: {settings.model_dump_json()}")
|
||||
g = Github(settings.token.get_secret_value())
|
||||
g = Github(settings.github_token.get_secret_value())
|
||||
repo = g.get_repo(settings.github_repository)
|
||||
|
||||
pr_nodes = get_pr_nodes(settings=settings)
|
||||
|
|
|
|||
Loading…
Reference in New Issue