Skip to content

tqer39/openai-generate-pr-description

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

header

OpenAI Generate PR Title and Description

This workflow uses an article generation model by OpenAI to generate the title and body of a pull request.

Usage

name: OpenAI Generate PR Title and Description

on:
  pull_request:
    branches:
      - main
    types:
      - opened
      - synchronize

jobs:
  pull-request:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    permissions:
      pull-requests: write
      contents: read
    if: contains(fromJSON('["renovate[bot]"]'), github.event.pull_request.user.login) == false
    steps:
      - uses: actions/checkout@v4
      - uses: tqer39/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          openai-api-key: ${{ secrets.OPENAI_API_KEY }}

Inputs

github-token

Required GitHub token. Specify ${{ secrets.GITHUB_TOKEN }}.

openai-api-key

Required OpenAI API key. Specify ${{ secrets.OPENAI_API_KEY }}.

openai-model

Optional OpenAI model to use. Default is gpt-3.5-turbo.

Note

  • 📝 The default model is gpt-3.5-turbo and can be used for free in the OpenAI API specification. If you use another model, you may incur charges for the OpenAI API.

commit-log-history-limit

Optional Limit of commit log history. Default is 70.

Note

  • 📝 Due to the limit of the number of tokens that can be used in one request in the OpenAI API specification, limiting the number of commit log histories can prevent request failures.

Contribution

If you find any issues or have improvements, please create an Issue or submit a Pull Request.

License

This action is released under the MIT license. For more information, see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages