Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lwydyby/mr-chglog

CHANGELOG generator by gitlab mr request
https://github.com/lwydyby/mr-chglog

changelog git git-chglog gitlab go

Last synced: 8 days ago
JSON representation

CHANGELOG generator by gitlab mr request

Awesome Lists containing this project

README

        

[![Go Report Card](https://goreportcard.com/badge/github.com/lwydyby/mr-chglog)](https://goreportcard.com/report/github.com/lwydyby/mr-chglog)
[![Quality](https://github.com/lwydyby/mr-chglog/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/lwydyby/mr-chglog/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/lwydyby/mr-chglog/badge.svg?branch=main)](https://coveralls.io/github/lwydyby/mr-chglog?branch=main)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/lwydyby/mr-chglog/blob/master/LICENSE)

# mr-chglog

## 简介

读取Gitlab的MR title生成中文CHANGELOG

## 安装

```bash
bash build.sh
```

## 使用说明

### 初始化

```bash
mr-chlog --init
```

### 生成CHANGELOG

```bash
mr-chlog
```

### 发送Release通知到飞书群

#### 命令行方式
```bash
mr-chlog --bot --app_id xxxx --app_secret xxxxxxx \
--chat_id xxxxxxx --bot_title xxxxxxx --config /etc/config/mr_config.yml \
--repository-url xxxx --token xxxx {tag}
```

#### 参数说明

``` bash
USAGE:
mr-chglog [options]

There are the following specification methods for .

1. .. - MR contained in tags from .
2. .. - MR from the to the latest tag.
3. .. - MR from the oldest tag to .
4. - MR contained in .

OPTIONS:
--init generate the mr-chglog configuration file in interactive (default: false)
--app_id value feishu robot app secret
--app_secret value feishu robot app secret
--chat_id value feishu robot send group chat_id,Please use , to separate multiple
--bot_title value feishu robot send release title
--path value [ --path value ] Filter commits by path(s). Can use multiple times.
--config value, -c value specifies a different configuration file to pick up (default: ".chglog/mr_config.yml")
--template value, -t value specifies a template file to pick up. If not specified, use the one in config
--repository-url value specifies git repo URL. If not specified, use 'repository_url' in config
--token value specifies git repo token. If not specified, use 'token' in config
--output value, -o value output path and filename for the changelogs. If not specified, output to stdout
--next-tag value treat unreleased commits as specified tags (EXPERIMENTAL)
--create-tag value create tag by CHANGELOG
--ai use ai create CHANGELOG (default: false)
--ai-type value which ai API to use create CHANGELOG (default: poe)
--bot push mr-chglog changelog to feishu group (default: false)
--help, -h show help
--version, -v print the version

EXAMPLE:

$ mr-chglog

If is not specified, it corresponds to all tags.
This is the simplest example.

$ mr-chglog 1.0.0..2.0.0

The above is a command to generate CHANGELOG including MR of 1.0.0 to 2.0.0.

$ mr-chglog 1.0.0

The above is a command to generate CHANGELOG including MR of only 1.0.0.

$ mr-chglog $(git describe --tags $(git rev-list --tags --max-count=1))

The above is a command to generate CHANGELOG with the MR included in the latest tag.

$ mr-chglog --output CHANGELOG.md

The above is a command to output to CHANGELOG.md instead of standard output.

$ mr-chglog --config custom/dir/config.yml

The above is a command that uses a configuration file placed other than ".chglog/config.yml".

$ mr-chglog --path path/to/my/component --output CHANGELOG.component.md

Filter commits by specific paths or files in git and output to a component specific changelog.
$ mr-chglog --bot
Push mr-chglog Changelog to Feishu Group
$ mr-chglog --ai
Use ai create CHANGELOG

```

## MR Description约定
### 数据库变更
![image](https://github.com/lwydyby/mr-chglog/assets/30611869/5a7b11f7-509a-4cfd-95d8-aa2e1cda8b8e)
### break变更
![image](https://github.com/lwydyby/mr-chglog/assets/30611869/a7f2474b-0be7-444b-bdf5-fd7723da8d1a)

## TODO

- [x] 支持更丰富的模板
- [x] 支持解析MR的描述,更完善的CHANGELOG
- [x] 直接将MR Diff发送给Chatgpt(或者其他AI) 生成更准确的CHANGELOG
- [x] 支持自动生成TAG 并上传CHANGELOG

## Thanks
[git-chlog](https://github.com/git-chglog/git-chglog)