Coder Social home page Coder Social logo

chatgpt-action's Introduction

chatgpt-action

Let chatgpt review your PR.

Please note: this repo is a WIP and I do not recommend you to use it in production!

Ideas

  • Create a vscode extension that asks ChatGPT to refactor or point out the bugs of a selected range of code. I don't have time to learn vscode extension and implement it.
  • Implement ChatGPT's review feedback as a commit or suggested change (#27)

Warning

  • code of experimental quality!
  • ChatGPT often generates misleading comments which could confuse your contributors and that's one reason against using this action in production.
  • Sometimes you will get 403 errors when the generated prompt is too long or considered an attack(perhaps?).
    • Split the prompt and let ChatGPT comment on every single file should resolve this issue most of the time.
    • This feature has been implemented but it is unstable. Add split: true to with node in your config to enable this feature.

Showcase

YOLO Mode: Give all the info to ChatGPT in one go

Using Unstable Split Feature

Usage

on: [pull_request]

name: ChatGPT CodeReview

jobs:
  chatgpt_comment:
    runs-on: ubuntu-latest
    name: Let chatgpt comment on your PR.
    steps:
      - name: ChatGPT comment
        uses: kxxt/[email protected]
        id: chatgpt
        with:
          number: ${{ github.event.pull_request.number }}
          sessionToken: ${{ secrets.CHATGPT_SESSION_TOKEN }}
          split: 'yolo'  # Use true to enable the unstable split feature.
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

chatgpt-action's People

Contributors

ademidun avatar dependabot[bot] avatar kxxt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-action's Issues

How to test locally

I recently tried to use it through GitHub actions but I saw your comment about OpenAI integrating Cloudflare into their ChatGPT app. How do I test this locally?

Idea: Implement ChatGPT's feedback as a commit or suggested change

This is a really cool idea Levi! @kxxt. I've been really impressed by the ingenuity of all the awesome ways people are implementing ChatGPT.

One thing I thought while reading this project. Instead of just asking it to tell you what you did wrong, why stop there? We can also ask it to rewrite the code without the mistake and commit those changes to the PR.

For example, in #12, ChatGPT points out the errors made in this comment. You can also go a step further and ask it to rewrite that file with those errors fixed.

"if there are any errors in this file, rewrite this file without errors"

Then extract the code snippet and commit it.

There's some resources that show how to push commits in a Github Action

If people don't want to give the bot full commit access, they can start by just allowing it to suggest changes. A tool like action-suggester could be used.

Imagine a workflow where:

  1. Human writes some code
  2. Chat GPT summarizes changes and gives feedback
  3. ChatGPT adds recommendations as a suggested change or commits changes directly to branch/PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.