PR Summary
PR Summary is a GitHub Action that generates a summary of a pull request (PR) and adds it as a comment to the PR. The summary includes the PR title, description, and a generated summary of the changes made in the PR.
How it works
- When a new pull request is opened, the GitHub Action is triggered.
- The action fetches the PR information using the GitHub API, including the PR title, description, and diff.
- The diff is passed to the OpenAI API to generate a summary of the changes made in the PR.
- The action adds a comment to the PR with the PR summary.
Usage
name: PR summary
on:
pull_request:
types:
- "opened"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Install deps
run: npm install
- name: Run PR summary action
uses: skarthikeyan96/typescript-custom-action@0.0.1
with:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Note:
Giving read and write permission as the action will be post an comment in the PR.
