Skip to content

Commit

Permalink
feat: faster check with head request (#2172)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Nov 28, 2024
1 parent 79183e2 commit 60be26b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,16 @@ def _maintainer_exists(maintainer: str) -> bool:
# orgs so we make sure it fails
# we do not allow redirects to ensure we get the correct status code
# for the specific URL we requested
req_profile = requests.get(
f"https://github.com/{maintainer}?tab=repositories",
req_profile = requests.head(
f"https://github.com/{maintainer}",
allow_redirects=False,
)
is_user = req_profile.status_code == 200
req_org = requests.get(
req_org = requests.head(
f"https://github.com/orgs/{maintainer}/teams",
allow_redirects=False,
)
is_org = req_org.status_code == 200
is_org = req_org.status_code < 400

return is_user and not is_org

Expand Down

0 comments on commit 60be26b

Please sign in to comment.