Skip to content

Commit

Permalink
remove PAT expiration date code entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
Aariq committed Jan 9, 2025
1 parent 3895024 commit ded2ea5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
8 changes: 0 additions & 8 deletions ghrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,3 @@ async def get_org_repos(org: str, token: str | None = None) -> list[GitHubRepo]:
else:
response.raise_for_status()
return repos


def find_token_expiration(token: str):
"""Return the time left on the GH personal access token."""
res = httpx.get("https://api.github.com/", headers={"Authorization": f"Bearer {token}"})
res.raise_for_status()
expiry = datetime.fromisoformat(res.headers["GitHub-Authentication-Token-Expiration"])
return expiry - datetime.now(tz=expiry.tzinfo)
4 changes: 0 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
# First, load the github PAT
GH_PAT = os.environ.get("GH_PAT")

# find out if the token is valid
PAT_MSG = None

# First, load the configuration file
with Path("config.toml").open("r", encoding="UTF-8") as f:
config = toml.load(f)
Expand All @@ -29,7 +26,6 @@
"metrics": config["metrics"],
"repos": repos,
"page": config["page"],
#"patmsg": PAT_MSG,
}

out = template.render(var_dict)
Expand Down

0 comments on commit ded2ea5

Please sign in to comment.