Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitamalinov committed Feb 23, 2024
1 parent 482dbed commit 5457b2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def get_env_var(name: str) -> str:
GITHUB_PRIVATE_KEY_ENCODED: str = get_env_var(name="GITHUB_PRIVATE_KEY")
print(GITHUB_PRIVATE_KEY_ENCODED)
print(len(GITHUB_PRIVATE_KEY_ENCODED))
if(get_env_var("ENV") == "local"):
ENV = get_env_var("ENV")
if(ENV == "local"):
GITHUB_PRIVATE_KEY_ENCODED = GITHUB_PRIVATE_KEY_ENCODED + '==\n-----END RSA PRIVATE KEY-----"}'
print(GITHUB_PRIVATE_KEY_ENCODED)
print(len(GITHUB_PRIVATE_KEY_ENCODED))
Expand Down
6 changes: 4 additions & 2 deletions services/github/webhook_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from agent.coders import Coder
from agent.inputoutput import InputOutput
from agent.models import Model
from config import LABEL, GITHUB_APP_ID, GITHUB_PRIVATE_KEY, SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY
from config import LABEL, GITHUB_APP_ID, GITHUB_PRIVATE_KEY, SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, ENV
from services.github.github_manager import GitHubManager
from services.github.github_types import GitHubInstallationPayload, GitHubLabeledPayload, IssueInfo
from services.supabase.supabase_manager import InstallationTokenManager
Expand Down Expand Up @@ -80,7 +80,9 @@ async def handle_issue_labeled(payload: GitHubLabeledPayload):

# Create and get into tmp folder
original_path: str = os.getcwd()
tmp_folder = original_path + '/tmp'
tmp_folder = '/tmp'
if(ENV == "local"):
tmp_folder = original_path + '/tmp'
if not os.path.exists(tmp_folder):
os.makedirs(tmp_folder)
os.chdir(tmp_folder)
Expand Down

0 comments on commit 5457b2e

Please sign in to comment.