subdee/gitlab-chlog
一个简单的php脚本来通过gitlab API v3生成变更日志
0.0.4
2015-07-09 11:52 UTC
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2024-09-23 05:53:39 UTC
README
一个通过gitlab api v3生成变更日志的php脚本
用法
composer.json
{ "require": { "subdee/gitlab-changelog": "0.0.1" } }
index.php
<?php require "vendor/autoload.php"; use GitlabChangelog\GitlabChangelog; $changelog = new GitlabChangelog(); $changelog->url = "GITLAB URL"; $changelog->repo = "REPO NAME"; $changelog->token = "YOUR PRIVATE TOKEN"; $changelog->getLabels = function($issue) { $label = "Fixed"; $map = array( "bug" => "Fixed", "enhancement" => "Improved", "feature" => "Added" ); foreach($map as $k => $v) { if(strripos(implode(',', $issue->labels), $k) !== FALSE) { $label = $v; break; } } return array($label); }; $markdown = $changelog->markdown(); file_put_contents("changelog.md", $markdown);
运行
composer install php index.php