Skip to content

Commit 68c2340

Browse files
Merge pull request #11 from robbievanleeuwen/fix/save-data-gh-pat
Use gh-pat for when calling all save_data instances
2 parents 5fd5246 + 1307252 commit 68c2340

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/upgrade_dependencies/main.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def check_dependency(
131131
rprint(f"Cannot find {dependency} in {project.name}.")
132132
raise typer.Exit(code=1) from e
133133

134-
asyncio.run(dep.save_data())
134+
if isinstance(dep, GitHubDependency):
135+
asyncio.run(dep.save_data(gh_pat=GH_PAT))
136+
else:
137+
asyncio.run(dep.save_data())
135138

136139
title = Text("Dependency Check", style="bold")
137140
needs_update = dep.needs_update()
@@ -325,7 +328,11 @@ def update(
325328

326329
# fetch data from pypi/github
327330
progress.update(task, description="Fetching dependency data...")
328-
asyncio.run(dep.save_data())
331+
332+
if isinstance(dep, GitHubDependency):
333+
asyncio.run(dep.save_data(gh_pat=GH_PAT))
334+
else:
335+
asyncio.run(dep.save_data())
329336

330337
# get latest/desired version
331338
if version is None:

0 commit comments

Comments
 (0)