Skip to content

Commit

Permalink
ci: fix ai code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jotanarciso committed Nov 6, 2024
1 parent 71d9835 commit 871b105
Showing 1 changed file with 14 additions and 40 deletions.
54 changes: 14 additions & 40 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,25 @@ permissions:

jobs:
ai-code-review:
name: AI Code Review
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout Current Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
- name: Checkout Azion Actions
uses: actions/checkout@v3
with:
node-version: '18'

- name: Install dependencies
run: |
npm install
npm run compile
npm install @actions/github
- name: Run Azion AI Code Review
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AZION_TOKEN: ${{ secrets.AZION_TOKEN }}
run: |
node ./scripts/code-review.mjs
continue-on-error: true
id: code_review

- name: Display error logs
if: failure() && steps.code_review.outcome == 'failure'
run: |
echo "Error during code review execution:"
cat ${{ github.workspace }}/*.log
repository: aziontech/azion-github-actions
ref: main
path: .github/actions
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update PR Status
uses: actions/github-script@v6
- name: Run AI Code Review
uses: ./.github/actions/actions/azion-ai-code-review
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Azion AI Code Review',
head_sha: context.payload.pull_request.head.sha,
status: 'completed',
conclusion: 'success',
output: {
title: 'Code review completed',
summary: 'The code review was completed successfully.'
}
})
azion-token: ${{ secrets.AZION_TOKEN }}
prompt: |
Analyze the following pull request and provide a summary of what it implements, including good practices, possible problems, and suggestions for improvement. Please keep the response concise.
max-files: 1000

0 comments on commit 871b105

Please sign in to comment.