Spaces:
Sleeping
Sleeping
Commit ·
ccedd77
1
Parent(s): 7c7cae5
Fix PEM key parsing — handle escaped newlines from HF Spaces
Browse files- app/github/auth.py +5 -1
app/github/auth.py
CHANGED
|
@@ -67,7 +67,11 @@ def _generate_jwt() -> str:
|
|
| 67 |
if _private_key is None:
|
| 68 |
if settings.github_app_private_key:
|
| 69 |
# Cloud deployment: key content passed directly via env var
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
else:
|
| 72 |
# Local development: read from .pem file
|
| 73 |
project_root = Path(__file__).resolve().parent.parent.parent
|
|
|
|
| 67 |
if _private_key is None:
|
| 68 |
if settings.github_app_private_key:
|
| 69 |
# Cloud deployment: key content passed directly via env var
|
| 70 |
+
# HF Spaces may strip newlines — restore them if needed
|
| 71 |
+
key = settings.github_app_private_key
|
| 72 |
+
if "\\n" in key:
|
| 73 |
+
key = key.replace("\\n", "\n")
|
| 74 |
+
_private_key = key
|
| 75 |
else:
|
| 76 |
# Local development: read from .pem file
|
| 77 |
project_root = Path(__file__).resolve().parent.parent.parent
|