Skip to content

Commit

Permalink
Fix bool variable issue by using the proper names. Clean up logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
TechNickAI committed Sep 3, 2023
1 parent 0ebac40 commit 0097f2a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aicodebot_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json, os, subprocess, sys


def main(comment_on_commit=True):
def main(do_comment_on_commit=True):
"""Run the AICodeBot action"""
cli_runner = setup_cli()
review_status, review_comments = review_code(cli_runner)
Expand All @@ -17,7 +17,7 @@ def main(comment_on_commit=True):
else:
exit_status = 0

if comment_on_commit:
if do_comment_on_commit:
comment_on_commit(review_status, review_comments)
sys.exit(exit_status)

Expand All @@ -28,7 +28,7 @@ def setup_cli():
# Check if required inputs are set
openai_api_key = os.getenv("INPUT_OPENAI_API_KEY") # Note this is prefixed with INPUT_ through actions
if not openai_api_key:
print(
logger.error(
"""
🛑 The OPENAI_API_KEY is not set. This key is required for the AICodeBot.
You can get one for free at https://platform.openai.com/account/api-keys
Expand All @@ -39,7 +39,7 @@ def setup_cli():
"""
)
if os.getenv("GITHUB_BASE_REF"):
print("Since this failure on a forked repository, we'll let the action pass without code review.")
logger.success("Since this failure on a forked repository, we'll let the action pass without code review.")
sys.exit(0)
else:
sys.exit(1)
Expand Down

0 comments on commit 0097f2a

Please sign in to comment.