freeedcom / ai-codereviewer

AI Code Reviewer: Enhance your GitHub workflow with AI-powered code review! Get intelligent feedback and suggestions on pull requests using OpenAI's GPT-4 API, improving code quality and saving developers time.
MIT License
571 stars 543 forks source link

Possibility of adding workflow_dispatch event support? #20

Open jaredstorm opened 1 year ago

jaredstorm commented 1 year ago

Hey! I'm wondering if it'd be possible to add workflow_dispatch as a supported event.

Here are my reasons:

  1. My use case is for a unity game that I'm working on. Many of the changes I put into pull requests are just for things like adding image or sound assets, or obligatory meta files for the unity engine that need to be tracked alongside game resources. That means pull requests can get to be hundreds of files big without really doing much with actual code. I really appreciate the exclusion filter and am using it, but it'd be nice to be able to opt in to an AI assisted review when I know my changes are code heavy and need extra eyes, instead of having to opt out of an already running workflow and cancel it when it's not really needed.

  2. Cost savings. Since OpenAI is a paid service, being able to opt in to a review would save money for the user long term.

  3. It would also make it possible to select from multiple different models in the UI. For example:

    workflow_dispatch:
    inputs:
      model:
        description: 'Model'
        required: true
        default: 'gpt-3.5-turbo-16k'
        type: 'choice'
        options:
          - gpt-3.5-turbo
          - gpt-3.5-turbo-0301
          - gpt-3.5-turbo-16k-0613
          - gpt-3.5-turbo-16k
          - gpt-3.5-turbo-0613
          - gpt-4

    would make it so if someone felt they needed GPT to have a bigger context to work with for one pull request vs another, they wouldn't have to go into their .yml files or modify their github environment entries.

I've never written an action before, but I can also take a crack at making a pull request when I get a little free time if you're up for this idea!

jaredstorm commented 1 year ago

Or adding support for review_requested which seems like it might be simpler and does most of the above, sans picking your model at request time.

villesau commented 1 year ago

I'm fine with that if the current way can still be used as a default. If that's possible, feel free to open a PR.

jaredstorm commented 1 year ago

Awesome! Do you have any good resources on how to get started with developing github actions? I'm used to using them but haven't made/modified one before.

villesau commented 1 year ago

Not really unfortunately :/ If you find some, please link them here!