diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index e69de29b..00000000 diff --git a/Dockerfile.github_action_dockerhub b/Dockerfile.github_action_dockerhub new file mode 100644 index 00000000..61d64e25 --- /dev/null +++ b/Dockerfile.github_action_dockerhub @@ -0,0 +1 @@ +FROM codiumai/pr-agent:github_action diff --git a/action.yaml b/action.yaml index b592abee..a6ffe834 100644 --- a/action.yaml +++ b/action.yaml @@ -2,4 +2,4 @@ name: 'PR Agent' description: 'Summarize, review and suggest improvements for pull requests' runs: using: 'docker' - image: 'Dockerfile.github_action' + image: 'Dockerfile.github_action_dockerhub' diff --git a/pr_agent/servers/github_action_runner.py b/pr_agent/servers/github_action_runner.py index 49e58220..ba6ffe9c 100644 --- a/pr_agent/servers/github_action_runner.py +++ b/pr_agent/servers/github_action_runner.py @@ -19,10 +19,11 @@ async def run_action(): if not GITHUB_EVENT_PATH: print("GITHUB_EVENT_PATH not set") return - event_payload = json.load(open(GITHUB_EVENT_PATH, 'r')) - RUNNER_DEBUG = os.environ.get('RUNNER_DEBUG', None) - if not RUNNER_DEBUG: - print("RUNNER_DEBUG not set") + try: + event_payload = json.load(open(GITHUB_EVENT_PATH, 'r')) + except json.decoder.JSONDecodeError as e: + print(f"Failed to parse JSON: {e}") + return OPENAI_KEY = os.environ.get('OPENAI_KEY', None) if not OPENAI_KEY: print("OPENAI_KEY not set") @@ -64,6 +65,8 @@ async def run_action(): if matches: question = matches[0][1] await PRQuestions(pr_url, question).answer() + else: + print(f"Unknown command: {body}") if __name__ == '__main__': diff --git a/pr_agent/tools/pr_reviewer.py b/pr_agent/tools/pr_reviewer.py index 109a9b74..3168e459 100644 --- a/pr_agent/tools/pr_reviewer.py +++ b/pr_agent/tools/pr_reviewer.py @@ -96,12 +96,12 @@ class PRReviewer: if not self.cli_mode: markdown_text += "\n### How to use\n" - commands_text = "> /review or /review_pr - Ask for a new review after your update the PR\n" \ - "> /describe or /describe_pr - Modify the PR title and description based " \ + commands_text = "> /review - Ask for a new review after your update the PR\n" \ + "> /describe - Modify the PR title and description based " \ "on the PR's contents.\n" \ - "> /improve or /improve_code - Suggest improvements to the code in the PR as pull " \ + "> /improve - Suggest improvements to the code in the PR as pull " \ "request comments ready to commit.\n" \ - "> /ask /ask_question - Ask a question about the PR.\n" + "> /ask - Ask a question about the PR.\n" if user and '[bot]' not in user: markdown_text += f"> Tag me in a comment '@{user}' and add one of the following commands:\n" + \ commands_text