Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into chore/pull-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
genisd committed Oct 10, 2023
2 parents bb4c19e + f76d18b commit 3c2cb07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ branding:
color: 'green'
runs:
using: 'docker'
image: 'Dockerfile.github_action_dockerhub'
image: 'Dockerfile.github_action'
7 changes: 5 additions & 2 deletions pr_agent/servers/github_action_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ async def run_action():
print(f"Failed to parse JSON: {e}")
return

print('handling ' + GITHUB_EVENT_NAME + ' event')
# Handle pull request event
if GITHUB_EVENT_NAME == "pull_request":
action = event_payload.get("action")
if action in ["opened", "reopened"]:
print('handling ' + action + ' action')
if action in ["opened", "reopened", "synchronize", "ready_for_review"]:
pr_url = event_payload.get("pull_request", {}).get("url")
if pr_url:
auto_review = os.environ.get('github_action.auto_review', None)
Expand All @@ -68,6 +70,7 @@ async def run_action():
# Handle issue comment event
elif GITHUB_EVENT_NAME == "issue_comment":
action = event_payload.get("action")
print('handling ' + action + ' action')
if action in ["created", "edited"]:
comment_body = event_payload.get("comment", {}).get("body")
if comment_body:
Expand All @@ -89,4 +92,4 @@ async def run_action():


if __name__ == '__main__':
asyncio.run(run_action())
asyncio.run(run_action())

0 comments on commit 3c2cb07

Please sign in to comment.