This workflow uses an article generation model by OpenAI to generate the title and body of a pull request.
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 }}
Required GitHub token. Specify ${{ secrets.GITHUB_TOKEN }}
.
Required OpenAI API key. Specify ${{ secrets.OPENAI_API_KEY }}
.
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.
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.
If you find any issues or have improvements, please create an Issue or submit a Pull Request.
This action is released under the MIT license. For more information, see LICENSE.