GitHub Actions

GitHub Actions Integration

Add Peqy to your repository with a simple GitHub Action.

Setup

Step 1: Add API Key Secret

  1. Go to your repository's Settings
  2. Navigate to Secrets and variables → Actions
  3. Click New repository secret
  4. Name: PEQY_API_KEY
  5. Value: Your API key from the Peqy dashboard

Step 2: Create Workflow

Create .github/workflows/peqy-review.yml in your repository:

name: Peqy Code Review
 
on:
  pull_request:
    types: [opened, synchronize, reopened]
 
jobs:
  peqy-review:
    name: Run Peqy Review
    runs-on: ubuntu-latest
 
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
 
      - name: Trigger Peqy Review
        uses: peqy/action@main
        with:
          api-key: ${{ secrets.PEQY_API_KEY }}

Step 3: Disable Auto-Run (Recommended)

If you're using the GitHub Action, disable webhook-triggered analysis to avoid duplicate reviews.

Create .peqy/config.yml in your repository:

version: "1.0"
auto_run: false

This ensures Peqy only runs when triggered by the GitHub Action, not on every PR event.

Step 4: Commit and Push

Commit the workflow file and push to your repository:

git add .github/workflows/peqy-review.yml
git commit -m "Add Peqy code review workflow"
git push

What Happens Next

When you open or update a pull request:

  1. GitHub Actions triggers the workflow
  2. The Peqy action sends your PR URL to the Peqy API
  3. Peqy analyzes your code changes
  4. Results appear as a GitHub Check Run on your PR

Troubleshooting

API Key Not Working

  • Ensure the secret is named exactly PEQY_API_KEY
  • Verify your API key is valid in the Peqy dashboard
  • Check that the repository has access to the secret

Workflow Not Triggering

  • Ensure the workflow file is in .github/workflows/
  • Check that the file has the correct YAML syntax
  • Verify the workflow is enabled in your repository's Actions tab