mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 02:45:18 +00:00
Handle OPENAI_KEY not set error in github_action_runner.py
Fixes https://github.com/Codium-ai/pr-agent/issues/855
This commit is contained in:
parent
af8ca7d1a4
commit
4c83bf695d
1 changed files with 5 additions and 4 deletions
|
|
@ -46,15 +46,16 @@ async def run_action():
|
||||||
if not GITHUB_EVENT_PATH:
|
if not GITHUB_EVENT_PATH:
|
||||||
print("GITHUB_EVENT_PATH not set")
|
print("GITHUB_EVENT_PATH not set")
|
||||||
return
|
return
|
||||||
if not OPENAI_KEY:
|
|
||||||
print("OPENAI_KEY not set")
|
|
||||||
return
|
|
||||||
if not GITHUB_TOKEN:
|
if not GITHUB_TOKEN:
|
||||||
print("GITHUB_TOKEN not set")
|
print("GITHUB_TOKEN not set")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Set the environment variables in the settings
|
# Set the environment variables in the settings
|
||||||
get_settings().set("OPENAI.KEY", OPENAI_KEY)
|
if OPENAI_KEY:
|
||||||
|
get_settings().set("OPENAI.KEY", OPENAI_KEY)
|
||||||
|
else:
|
||||||
|
# Might not be set if the user is using models not from OpenAI
|
||||||
|
print("OPENAI_KEY not set")
|
||||||
if OPENAI_ORG:
|
if OPENAI_ORG:
|
||||||
get_settings().set("OPENAI.ORG", OPENAI_ORG)
|
get_settings().set("OPENAI.ORG", OPENAI_ORG)
|
||||||
get_settings().set("GITHUB.USER_TOKEN", GITHUB_TOKEN)
|
get_settings().set("GITHUB.USER_TOKEN", GITHUB_TOKEN)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue