Skip to content

Summarize PR

Actions
A simple GitHub action that can create a brief information about commits in a pull request(PR)
v2.0.0
Latest
Star (5)

Summarize Pull Request

A simple GitHub action that can create a brief information about commits in a pull request(PR). So, within brief, initial description of commit changes helps reviewing the PR.

And also if there are some TODOs comment in the code, an issue is generated automatically to follow-up the TODO.

For example, if there is a TODO comment like below in the PR, within this action an issue will be created.

//TODO: Create GitHub issue

And within the created issue some brief code is also suggested so that for whom will take care of the issue will have some starting point. Suggested codes will be generated by given "AI Model(LLM)" in the action definition.

Check following visuals to have more idea:

PR Description
Image
Auto-generated issue for TODOs
alt text

How

With Microsoft.Extensions.AI, action provides access to use LLMs such as GPT-4o,Llama,Phi-3... to describe change sets. Within GitHub Models or Azure AI Model Catalog, models can be used with this action.

Add the following GitHub action definition to your GitHub Action workflows

name: Summarize PR

on:
  pull_request:
    branches: [ "main" ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Summarize PR Action
      uses: ardacetinkaya/pull-request-action/@v1.0.0
      env:
        PAT: ${{ secrets.ACTION_TOKEN }}
        APIKey: ${{ secrets.AI_API_KEY }}
        ModelId: gpt-4o
        RepositoryName: ${{github.event.repository.name}}
        RepositoryAccount: ${{github.repository_owner}}
        CommitSHA: ${{ github.event.pull_request.head.sha }}
        PullRequestId: ${{github.event.number}}

Requirements

  1. Create a GitHub Access Token to be able to use GitHub Apis
    • Read and write to pull request is required
  2. Create required access key for LLM models
  3. Create secrets for the above access assets in the GitHub repo.

Why

Mainly this is a kind of self-learning and proof-of-concept initiative to learn how LLMs can be used within .NET Platform.

References

Contributing

Contributions are more than welcome! Please submit a pull request or create an issue to discuss your ideas or feedbacks.

License

This project is licensed under the MIT License.

Summarize PR is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

A simple GitHub action that can create a brief information about commits in a pull request(PR)
v2.0.0
Latest

Summarize PR is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.