Skip to content

Commit

Permalink
Merge pull request #828 from idubnori/work/fix-827
Browse files Browse the repository at this point in the history
Improve trigger condition in github actions
  • Loading branch information
mrT23 committed Mar 27, 2024
2 parents a8bee89 + 020a29e commit a86913a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/docs/installation/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ You can use our pre-built Github Action Docker image to run PR-Agent as a Github
```yaml
on:
pull_request:
types: [opened, reopened, ready_for_review]
issue_comment:
jobs:
pr_agent_job:
if: ${{ github.event.sender.type != 'Bot' }}
runs-on: ubuntu-latest
permissions:
issues: write
Expand All @@ -28,10 +30,12 @@ jobs:
```yaml
on:
pull_request:
types: [opened, reopened, ready_for_review]
issue_comment:

jobs:
pr_agent_job:
if: ${{ github.event.sender.type != 'Bot' }}
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down
2 changes: 2 additions & 0 deletions pr_agent/servers/github_action_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ async def run_action():
await PRReviewer(pr_url).run()
if auto_improve is None or is_true(auto_improve):
await PRCodeSuggestions(pr_url).run()
else:
get_logger().info(f"Skipping action: {action}")

# Handle issue comment event
elif GITHUB_EVENT_NAME == "issue_comment" or GITHUB_EVENT_NAME == "pull_request_review_comment":
Expand Down

0 comments on commit a86913a

Please sign in to comment.