Skip to content

Commit

Permalink
[NO-ISSUE] chore: add ai review workflows in pull requests (#2116)
Browse files Browse the repository at this point in the history
* chore: add ai review workflows in pull requests

* chore: update ai review workflow to use ubuntu-latest runner

* chore: enhance ai pr review workflow with additional features

* chore: remove base_ref condition in ai review workflow

* fix: adjust workflow

* fix: adjust workflow
  • Loading branch information
lucasmendes21 authored Jan 31, 2025
1 parent 998fa40 commit 62dec45
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: AI Code Reviewer
on:
pull_request:
types:
- opened
- synchronize
- converted_to_draft
- ready_for_review
- labeled

concurrency:
# Only one job per reference (branch or tag)
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

jobs:
comment-on-pr:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Comment on PR
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "🔍 AI Code Reviewer is analyzing this PR… Please wait for the results!"
})
review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: AI PR Reviewer
uses: coderabbitai/ai-pr-reviewer@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.AZION_OPEN_AI_SECRET }}
with:
debug: false
review_simple_changes: false
review_comment_lgtm: false

- name: Comment AI Review Completion
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "✅ AI Code Review completed! Check the comments for more details."
})

0 comments on commit 62dec45

Please sign in to comment.