Skip to content

This GitHub action generates a summary for pull requests using the OpenAI API

Notifications You must be signed in to change notification settings

splashdust/gh-action-pr-gpt-bot

Repository files navigation

GitHub PR GPT-Bot Action

This GitHub action generates a summary for pull requests using the OpenAI API. It uses the text-davinci-003 model to create a concise summary of the changes in a pull request and posts it as a comment on the pull request.

Usage

Add the following to your workflow configuration file in .github/workflows (e.g., pull_request_summary.yml):

name: Pull Request Summary

on:
  pull_request:
    types:
      - opened

jobs:
  generate_summary:
    runs-on: ubuntu-latest

    steps:
      - name: Check out repository
        uses: actions/checkout@v2

      - name: Generate pull request summary
        uses: splashdust/gh-action-pr-gpt-bot@1.0.0-beta.10
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          openaiApiKey: ${{ secrets.OPENAI_API_KEY }}
          openaiOrgId: ${{ secrets.OPENAI_ORG_ID }}
          githubContext: ${{ toJson(github) }}

Inputs

Name Description Required
token GitHub token Yes
openaiApiKey OpenAI API key Yes
openaiOrgId OpenAI Organization ID Yes
githubContext Github context object Yes

Secrets

The action requires the following secrets:

  • OPENAI_API_KEY: Your OpenAI API key. You can obtain one by signing up for an API key at https://beta.openai.com/signup.

  • OPENAI_ORG_ID: Your OpenAI Organization ID.

Contributing

If you would like to contribute to this project, please feel free to open an issue or create a pull request.

About

This GitHub action generates a summary for pull requests using the OpenAI API

Resources

Stars

Watchers

Forks

Packages

No packages published