Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review-copilot action tests #4

Merged
merged 16 commits into from
Nov 20, 2024
44 changes: 44 additions & 0 deletions .github/workflows/review-copilot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Review Co-Pilot

on:
pull_request:
types: [reopened, opened, synchronize]

jobs:
review-copilot:
runs-on: ubuntu-latest

steps:
- name: Checkout code
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider specifying a more precise Python version instead of '3.x' to ensure consistent execution environment.

uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install GitHub API library
run: |
python -m pip install --upgrade pip
pip install PyGithub

- name: Install pipx
run: |
python -m pip install --upgrade pip
python -m pip install pipx

- name: Install Review Copilot
run: |
pipx install "git+https://${{ secrets.REVIEW_COPILOT_KEY }}@github.com/scs-sandbox/review-copilot.git"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing error handling for the review-copilot command execution. The workflow should check the exit code and fail explicitly if the review fails.

- name: Run Review Copilot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.REVIEW_COPILOT_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.REVIEW_COPILOT_SECRET_ACCESS_KEY }}

run: |
REPO_NAME="${{ github.repository }}"
PR_NUMBER="${{ github.event.pull_request.number }}"

review-copilot review $REPO_NAME $PR_NUMBER
Loading