Skip to content

Commit

Permalink
fix: follow redirects for moved repos
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Apr 14, 2023
1 parent 83a53d4 commit dd14b96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ Unreleased

- Requests to GitHub are now made asynchronously, speeding execution.

- Redirections from GitHub (for example, if a repo is renamed or moved) are
followed transparently.

- The exit code is now 1 if any runs failed, 0 if all were successful.

- Long lines are no longer wrapped too short.
Expand Down
4 changes: 3 additions & 1 deletion src/watchgha/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ async def get_data(self, url):
async with httpx.AsyncClient() as client:
for _ in range(3):
try:
resp = await client.get(url, headers=self.headers, timeout=30)
resp = await client.get(
url, headers=self.headers, timeout=30, follow_redirects=True
)
except httpx.HTTPError as e:
raise WatchGhaError(e)
if resp.status_code not in self.RETRY_STATUS_CODES:
Expand Down

0 comments on commit dd14b96

Please sign in to comment.