Skip to content

mys1024/cr-asst-action

Repository files navigation

cr-asst-action

license version workflow-ci workflow-release

English | 中文

An action powered by cr-asst that reviews your pull requests with AI assistants.

Usage

  1. Create a workflow file .github/workflows/review-pr.yml with the following content:

    name: Review PR
    
    on:
      pull_request:
        types:
          - opened
          - synchronize
        branches:
          - main
    
    jobs:
      review:
        runs-on: ubuntu-latest
    
        steps:
          - name: Checkout repository
            uses: actions/checkout@v4
            with:
              fetch-depth: 0
    
          - name: Review
            uses: mys1024/cr-asst-action@v2
            with:
              github-token: ${{ secrets.GITHUB_TOKEN }} # required
              model: gpt-4 # required
              api-key: ${{ secrets.CR_API_KEY }} # required
              provider: openai # optional, defaults to "openai", options: "openai", "deepseek", "xai", "anthropic", "google"
              base-url: https://api.example.com/v1 # optional
              exclude: 'foo,bar/dir' # optional, defaults to "package-lock.json,pnpm-lock.yaml,yarn.lock"
              prompt-file: 'my-prompt.md' # optional, defaults to the builtin prompt "en"
              output-file: 'review-result.md' # optional

    Note: see action.yml for more details about inputs.

  2. Set the secret CR_API_KEY in your repository settings.

  3. Set the setting Workflow permissions to Read and write permissions in your repository settings.

Example

Click here to see the example.

License

MIT License © 2025-PRESENT mys1024

About

An action powered by cr-asst that reviews your pull requests with AI assistants.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published