Skip to content
Compare
Choose a tag to compare
@murtuzaalisurti murtuzaalisurti released this 14 Sep 07:27
· 19 commits to main since this release

Introducing Better

A code reviewer github action powered by AI, ready to be used in your workflow. - by @murtuzaalisurti

Features

  • Generate suggestions for PR changes using AI model of your choice.
  • Suggestions include sample code and references to verified external sources.
  • Supports industry leading platforms such as OpenAI and Anthropic.
  • Supports custom AI models.
  • Include custom rules for how the code should be.

Example workflow

name: Code Review
on:
    pull_request:
        types: [opened, reopened, synchronize, ready_for_review]
        branches:
            - main # change this to your target branch
    workflow_dispatch: # Allows you to run the workflow manually from the Actions tab

permissions: # necessary permissions
    pull-requests: write
    contents: read

jobs:
    your-job-name:
        runs-on: ubuntu-latest
        name: your-job-name
        steps:
            - name: step-name
              id: step-id
              uses: murtuzaalisurti/better@main # this is the ref of the github action - https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_iduses
              with:
                repo-token: ${{ secrets.GITHUB_TOKEN }} # this is auto generated
                ai-model-api-key: ${{ secrets.MODEL_API_KEY }} # make sure to set this in your repository secrets - /settings/secrets/actions (Settings > Secrets and Variables > Actions > Secrets Tab)
                platform: 'openai'
                delete-existing-review-by-bot: true #default is true
                filesToIgnore: '**/*.env, .husky/**' # uses glob patterns (micromatch - https://github.com/micromatch/micromatch)
                rules: |- # Rules to consider for code review
                    -- It must follow industry standard best practices
                    -- It should be idiomatic
                    -- It should be readable
                    -- It should not contain any security related vulnerabilities
                    -- It should not contain any sensitive data
                    -- It should be well structured
                    -- It should not contain bad patterns

Full Changelog: https://github.com/murtuzaalisurti/better/commits/v1.0.0