INNER CODE UNIT · Python
get_github_token
nolabs-ai/deepfabric · tools-sdk/components/github/app.py:31
def get_github_token() -> str:
"""Get GitHub token from Spin variables."""
try:
return variables.get("github_token")
except Exception:
return ""
def get_allowed_repos() -> set[str]:
"""Get set of allowed repositories from Spin variables."""
try:
repos_str = variables.get("allowed_repos")
if not repos_str or repos_str == "{{ allowed_repos }}":
return set() # Empty means allow all (for backwards compat)
return {r.strip().lower() for r in repos_str.split(",") if r.strip()}
except Exception:
return set()