-
Notifications
You must be signed in to change notification settings - Fork 210
Closed
Labels
P2bugSomething isn't workingSomething isn't workingcontributions wanted!Looking for external contributionsLooking for external contributionsintegration:github
Description
Describe the bug
Accessing public repositories doesn't require a GitHub token.
When we set a Secret corresponding to an env var in github_token:
- If the env var is not present, we fail with an expressive error message.
- If the env var is set but empty (as it can happen on some platforms), we end up passing
headers["Authorization"] = "Bearer", causing the request to fail.
I would not say it's a proper bug, but we can make the implementation more robust.
To Reproduce
from haystack_integrations.components.connectors.github import GitHubIssueViewer
from haystack.utils import Secret
import os
os.environ["GITHUB_TOKEN"] = ""
viewer = GitHubIssueViewer(github_token=Secret.from_env_var("GITHUB_TOKEN"))
result = viewer.run(url="https://github.com/deepset-ai/haystack-core-integrations/issues/2373")
# requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: ...Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2bugSomething isn't workingSomething isn't workingcontributions wanted!Looking for external contributionsLooking for external contributionsintegration:github
Type
Projects
Status
Done