Skip to content

PedroCavalheiro/codegpt

 
 

Repository files navigation

CodeGPT PR Assistant

Description

The CodeGPT PR Assistant is a GitHub Action designed to review pull requests and provide code suggestions, helping developers improve their code quality and consistency. It integrates with GitHub Actions to automatically analyze and comment on new pull requests and commits.

Features

  • Review pull request changes automatically.
  • Provide feedback and code suggestions.

Required ENV variables

  • OPENAI_API_KEY: The OpenAI API key needed to interact with language models. This var is required.
  • GITHUB_TOKEN: The GitHub API key needed to interact with GitHub's API. Usually available on your env. This var is required.

Inputs

  • OPENAI_ASSISTANT_ID: The ID of the OpenAI assistant being used. This input is required.

Outputs

  • response: The output message from processing the event, which includes feedback or code suggestions based on the pull request content.

Usage

To use this action in your GitHub workflows, add the following step:

name: Ask CodeGPT for feedback

on:
  pull_request:
    types: [opened, reopened, synchronize]
  issue_comment:
    types: [created]

jobs:
  process-events:
    runs-on: ubuntu-latest
    steps:
    - name: Run CodeGPT
      if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, 'CodeGPT') && !contains(github.event.comment.body,'The following is a message from CodeGPT:'))
      uses: isat/[email protected]
      with:
        OPENAI_ASSISTANT_ID: 'YOUR_ASSISTANT_ID_GOES_HERE'
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%