Coder Social home page Coder Social logo

kieranklaassen / gpt-auto-pr-description-action Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 3.0 34 KB

โœจ Automatically draft pull request descriptions! This GitHub action uses OpenAI's model to draft pull request descriptions for you. ๐ŸŽฏ

Ruby 100.00%
ai devtools gpt openai

gpt-auto-pr-description-action's Introduction

Change PR Description GitHub Action

This action is designed to automatically update or modify the description of a pull request. It uses OpenAI's GPT model to generate the description content based on the pull request content or a given template. This is especially useful when you want to maintain a standardized format across all pull request descriptions in a repository.

Inputs

The action takes several inputs:

  • github-token: Your GitHub token. This is required to interact with the GitHub API and is always required.
  • pr-number: The number of the pull request that the description should be updated for. This is also always required.
  • openai-token: Your OpenAI token. This is used to generate the description using OpenAI's models and is always required. Make sure to store this token as a GitHub secret and pass it as an input to your workflow.
  • pull-request-template: An optional path to a template file that should be used for generating the PR description. If not provided, the description will be generated based on the PR's content.
  • trigger-word: An optional trigger word that will trigger the action when found in the PR's description. If not provided, the default is "auto", which means the action will run automatically whenever a PR is opened.
  • openai-model: An optional parameter to specify the OpenAI model to be used for generating the PR description. If not provided, the default model is gpt-3.5-turbo-16k.
  • skip-if-author-is: An optional parameter to specify a list of authors (comma separated) for which the action should not run. By default, this is empty, meaning the action will run for all authors.

Usage

To use this action, you should add it to your GitHub workflow. Here is an example workflow that uses this action:

name: Draft PR Description
on:
  pull_request:
    types: [opened]

jobs:
  change-description:
    runs-on: ubuntu-latest
    steps:
      - name: Add Draft PR description
        uses: kieranklaassen/gpt-auto-pr-description-action@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          pr-number: ${{ github.event.pull_request.number }}
          openai-token: ${{ secrets.OPENAI_TOKEN }}

In this example, the action is triggered whenever a pull request is opened. It uses the github-token, pr-number, and openai-token inputs to interact with the GitHub API and generate the PR description. The OpenAI token is stored as a secret to keep it secure.

Dependencies

This action depends on:

  • Ruby and the ruby/setup-ruby action to set up a Ruby environment.
  • The actions/checkout action to check out the repository.
  • Your OpenAI token to access the OpenAI API. Make sure to store this token as a GitHub secret and pass it as an input to your workflow.

Contributing

Contributions to improve this action are welcomed. Feel free to open an issue or pull request in this repository.

License

This action is released under the MIT License.

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.