Skip to content

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.

License

Notifications You must be signed in to change notification settings

ardacetinkaya/summarize-pull-request-action

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

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks