rpopuc / lab-pr-changelog-generator

A Lab to implement a bot that generate changlog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lab: Changelog Generator

A POC for a pipeline that generates a changelog for a given PR - using code diffs and OpenAI's API - and adds it to the PR as a comment.

Example

Configuration

The secret OPENAI_API_KEY must be defined in Github in order for the application to authenticate with OpenAI's API.

How it works?

A python script generate_docs.py gets the diffs from the current PR and the main branch, classifies these diffs in 'added', 'modified' and 'deleted' blocks, and then requests a description from OpenAI's API based on these blocks:

Based only on this diffs:
Added code:
{added_code}

Deleted code:
{deleted_code}

Modified code:
{modified_code}.

Explain the main changes made to the code in terms of added, changed, or removed features, with one change per line.

About

A Lab to implement a bot that generate changlog


Languages

Language:PHP 100.0%