Skip to content

Auto PR: feature/fix-test-cases → main #131

Auto PR: feature/fix-test-cases → main

Auto PR: feature/fix-test-cases → main #131

Workflow file for this run

name: Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
# Run review when:
# 1. PR is opened
# 2. PR has actual code changes (before != after)
if: github.event.action == 'opened' || github.event.before != github.event.after
permissions:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Run ReviewCopilot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AI_API_KEY_OPENAI: ${{ secrets.AI_API_KEY_OPENAI }}
AI_API_KEY_DEEPSEEK: ${{ secrets.AI_API_KEY_DEEPSEEK }}
GITHUB_EVENT_NUMBER: ${{ github.event.issue.number || github.event.number }}
GITHUB_EVENT_TYPE: ${{ github.event_name }}
GITHUB_COMMENT_ID: ${{ github.event.comment.id }}
GITHUB_COMMENT_BODY: ${{ github.event.comment.body }}
run: node -r dotenv/config dist/cli/index.js review