-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NO-ISSUE] chore: add ai review workflows in pull requests (#2116)
* 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
1 parent
998fa40
commit 62dec45
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
}) |