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 |
---|
Auto-generated issue for TODOs |
---|
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.
- Azure AI Model Catalog - https://ai.azure.com/explore/models
- GitHub Models - https://github.com/marketplace/models
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}}
- Create a GitHub Access Token to be able to use GitHub Apis
- Read and write to pull request is required
- Create required access key for LLM models
- Create secrets for the above access assets in the GitHub repo.
Mainly this is a kind of self-learning and proof-of-concept initiative to learn how LLMs can be used within .NET Platform.
- Tutorial: Create a GitHub Action with .NET - https://learn.microsoft.com/en-us/dotnet/devops/create-dotnet-github-action
- Microsoft.Extensions.AI - https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/
Contributions are more than welcome! Please submit a pull request or create an issue to discuss your ideas or feedbacks.
This project is licensed under the MIT License.